From 9b9ed0ad0fff8586c554b297f20719f0cf4659f4 Mon Sep 17 00:00:00 2001 From: ilvalle Date: Sun, 29 May 2016 08:13:53 +0200 Subject: [PATCH] running lib2to3.fixes.fix_funcattrs --- gluon/sqlhtml.py | 2 +- gluon/tools.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index d5974c0a..ac12c107 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -60,7 +60,7 @@ def represent(field, value, record): if not callable(f): return str(value) 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): n -= 1 else: diff --git a/gluon/tools.py b/gluon/tools.py index b1ad982c..df517ebe 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -5297,10 +5297,10 @@ def reverse_geocode(lat, lng, lang=None): def universal_caller(f, *a, **b): - c = f.func_code.co_argcount - n = f.func_code.co_varnames[:c] + c = f.__code__.co_argcount + n = f.__code__.co_varnames[:c] - defaults = f.func_defaults or [] + defaults = f.__defaults__ or [] pos_args = n[0:-len(defaults)] named_args = n[-len(defaults):]