running lib2to3.fixes.fix_funcattrs
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ def represent(field, value, record):
|
|||||||
if not callable(f):
|
if not callable(f):
|
||||||
return str(value)
|
return str(value)
|
||||||
if hasattr(f,'func_code'):
|
if hasattr(f,'func_code'):
|
||||||
n = f.func_code.co_argcount - len(f.func_defaults or [])
|
n = f.__code__.co_argcount - len(f.__defaults__ or [])
|
||||||
if getattr(f, 'im_self', None):
|
if getattr(f, 'im_self', None):
|
||||||
n -= 1
|
n -= 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
+3
-3
@@ -5297,10 +5297,10 @@ def reverse_geocode(lat, lng, lang=None):
|
|||||||
|
|
||||||
|
|
||||||
def universal_caller(f, *a, **b):
|
def universal_caller(f, *a, **b):
|
||||||
c = f.func_code.co_argcount
|
c = f.__code__.co_argcount
|
||||||
n = f.func_code.co_varnames[:c]
|
n = f.__code__.co_varnames[:c]
|
||||||
|
|
||||||
defaults = f.func_defaults or []
|
defaults = f.__defaults__ or []
|
||||||
pos_args = n[0:-len(defaults)]
|
pos_args = n[0:-len(defaults)]
|
||||||
named_args = n[-len(defaults):]
|
named_args = n[-len(defaults):]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user