From a6b46c5f01b76bd87eb4e47cdac26f645e72d716 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 26 Apr 2021 10:18:00 +0100 Subject: [PATCH] Remove references to Python 2 objects These are no longer necessary in a Python 3-only world. Signed-off-by: Stephen Finucane Change-Id: Ia3eda6d451b673f3eafba1aa3ecd2e51b7038f1f --- debtcollector/_utils.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/debtcollector/_utils.py b/debtcollector/_utils.py index 2c36454..e6bff65 100644 --- a/debtcollector/_utils.py +++ b/debtcollector/_utils.py @@ -14,19 +14,10 @@ import functools import inspect -import types import warnings -try: - _TYPE_TYPE = types.TypeType -except AttributeError: - _TYPE_TYPE = type - - -# See: https://docs.python.org/2/library/__builtin__.html#module-__builtin__ -# and see https://docs.python.org/2/reference/executionmodel.html (and likely -# others)... -_BUILTIN_MODULES = ('builtins', '__builtin__', '__builtins__', 'exceptions') +# See https://docs.python.org/3/library/builtins.html +_BUILTIN_MODULES = ('builtins', 'exceptions') _enabled = True @@ -154,7 +145,7 @@ def get_callable_name(function): parts = (function.__module__, function.__name__) else: im_class = type(function) - if im_class is _TYPE_TYPE: + if im_class is type: im_class = function try: parts = (im_class.__module__, im_class.__qualname__)