From d74413bc1625c9ea9315872dd69ce578406738f4 Mon Sep 17 00:00:00 2001 From: ilvalle Date: Sun, 29 May 2016 08:32:36 +0200 Subject: [PATCH] running lib2to3.fixes.fix_methodattrs --- gluon/compileapp.py | 2 +- gluon/contrib/qdb.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gluon/compileapp.py b/gluon/compileapp.py index 0d8b94d5..6b53ee34 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -214,7 +214,7 @@ def LOAD(c=None, f='index', args=None, vars=None, request.env.path_info other_request.cid = target other_request.env.http_web2py_component_element = target - other_request.restful = types.MethodType(request.restful.im_func, other_request) # A bit nasty but needed to use LOAD on action decorates with @request.restful() + other_request.restful = types.MethodType(request.restful.__func__, other_request) # A bit nasty but needed to use LOAD on action decorates with @request.restful() other_response.view = '%s/%s.%s' % (c, f, other_request.extension) other_environment = copy.copy(current.globalenv) # NASTY diff --git a/gluon/contrib/qdb.py b/gluon/contrib/qdb.py index cc897d84..feaaaabd 100644 --- a/gluon/contrib/qdb.py +++ b/gluon/contrib/qdb.py @@ -391,16 +391,16 @@ class Qdb(bdb.Bdb): pass elif inspect.ismethod(obj): # Get the function from the object - f = obj.im_func + f = obj.__func__ drop_self = 1 elif inspect.isclass(obj): # Get the __init__ method function for the class. if hasattr(obj, '__init__'): - f = obj.__init__.im_func + f = obj.__init__.__func__ else: for base in object.__bases__: if hasattr(base, '__init__'): - f = base.__init__.im_func + f = base.__init__.__func__ break if f is not None: drop_self = 1 @@ -408,7 +408,7 @@ class Qdb(bdb.Bdb): # use the obj as a function by default f = obj # Get the __call__ method instead. - f = obj.__call__.im_func + f = obj.__call__.__func__ drop_self = 0 except AttributeError: pass