Author: Ronan Lamy <[email protected]>
Branch: online-transforms
Changeset: r74231:0382934f651e
Date: 2014-10-25 18:01 +0200
http://bitbucket.org/pypy/pypy/changeset/0382934f651e/
Log: revert normalize_method() change: it needs to always return an
InstanceMethod
diff --git a/rpython/tool/descriptor.py b/rpython/tool/descriptor.py
--- a/rpython/tool/descriptor.py
+++ b/rpython/tool/descriptor.py
@@ -36,10 +36,8 @@
if '__pypy__' in sys.modules:
def normalize_method(method):
- '''Turn everything that behaves like a method into a regular function
or an InstanceMethod object'''
+ '''Turn everything that behaves like a method into an InstanceMethod
object'''
if isinstance(method, types.MethodType):
- if method.__self__ is None:
- return method.im_func
return InstanceMethod(method.__func__, method.__self__,
method.im_class)
else:
raise ValueError('Not a method')
@@ -50,10 +48,8 @@
method_descriptor = type(str.join)
def normalize_method(method):
- '''Turn everything that behaves like a method into a regular function
or an InstanceMethod object'''
+ '''Turn everything that behaves like a method into an InstanceMethod
object'''
if isinstance(method, types.MethodType):
- if method.__self__ is None:
- return method.__func__
return InstanceMethod(method.__func__, method.__self__,
method.im_class)
elif isinstance(method, types.BuiltinMethodType):
im_self = method.__self__
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit