running lib2to3.fixes.fix_methodattrs

This commit is contained in:
ilvalle
2016-05-30 18:03:48 +02:00
parent 02e0cd187a
commit d74413bc16
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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