Remove references to Python 2 objects
These are no longer necessary in a Python 3-only world. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Ia3eda6d451b673f3eafba1aa3ecd2e51b7038f1f
This commit is contained in:
parent
6abd5a676d
commit
a6b46c5f01
@ -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__)
|
||||
|
Loading…
Reference in New Issue
Block a user