remove some support code for old python versions
This commit is contained in:
parent
73ff53c742
commit
c486598440
|
@ -4,7 +4,6 @@ python version compatibility code
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
import sys
|
import sys
|
||||||
import inspect
|
import inspect
|
||||||
import types
|
|
||||||
import re
|
import re
|
||||||
import functools
|
import functools
|
||||||
import codecs
|
import codecs
|
||||||
|
@ -120,16 +119,6 @@ def getfuncargnames(function, startindex=None, cls=None):
|
||||||
return tuple(argnames[startindex:])
|
return tuple(argnames[startindex:])
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info[:2] == (2, 6):
|
|
||||||
def isclass(object):
|
|
||||||
""" Return true if the object is a class. Overrides inspect.isclass for
|
|
||||||
python 2.6 because it will return True for objects which always return
|
|
||||||
something on __getattr__ calls (see #1035).
|
|
||||||
Backport of https://hg.python.org/cpython/rev/35bf8f7a8edc
|
|
||||||
"""
|
|
||||||
return isinstance(object, (type, types.ClassType))
|
|
||||||
|
|
||||||
|
|
||||||
if _PY3:
|
if _PY3:
|
||||||
imap = map
|
imap = map
|
||||||
izip = zip
|
izip = zip
|
||||||
|
@ -230,10 +219,7 @@ def getimfunc(func):
|
||||||
try:
|
try:
|
||||||
return func.__func__
|
return func.__func__
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
return func
|
||||||
return func.im_func
|
|
||||||
except AttributeError:
|
|
||||||
return func
|
|
||||||
|
|
||||||
|
|
||||||
def safe_getattr(object, name, default):
|
def safe_getattr(object, name, default):
|
||||||
|
|
Loading…
Reference in New Issue