[issue10922] Unexpected exception when calling function_proxy.__class__.__call__(function_proxy)

Andreas Stührk report at bugs.python.org
Mon Jan 17 03:50:18 CET 2011


Andreas Stührk <andy-python at hammerhartes.de> added the comment:

I think this is a duplicate of issue #9756: `methoddescr_call()` checks whether the given argument is acceptable as "self" argument and does so using `PyObject_IsInstance()`. As the class in the given code returns the type of the proxied object for the `__class__` attribute, that check will return true.

As a quick fix, the attached patch (against release27-maint branch) will raise a TypeError as expected by the OP, but the real issue is much broader.

----------
keywords: +patch
nosy: +Trundle
Added file: http://bugs.python.org/file20421/check_is_func.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10922>
_______________________________________


More information about the Python-bugs-list mailing list