logilab-common #79268 python3: monkeypatch failure with bound method [validation pending]
Fix added in :changeset:a5fc783ebbfb isn't sufficient. method_type() cannot support bound method monkeypatching (only class will be used by constructor). --- a/compat.py +++ b/compat.py @@ -61,11 +61,11 @@ except AttributeError: # See also http://bugs.python.org/issue11776 if sys.version_info[0] == 3: def method_type(callable, instance, klass): - return types.MethodType(callable, klass) + return types.MethodType(callable, instance or klass()) else: # alias types otherwise method_type = types.MethodType Traceback: unhandled exception occurred while testing unittest_ureports_html Traceback (most recent call last): File "/tmp/logilab-common-0.57.0/usr/lib64/python3.2/site-packages/logilab/common/pytest.py", line 11 29, in _ts_wrapped_run test._wrapped_run(result, debug, runcondition=runcondition, options=options) File "/tmp/logilab-common-0.57.0/usr/lib64/python3.2/site-packages/logilab/common/pytest.py", line 11 20, in _ts_wrapped_run self._handleModuleFixture(test, result) File "/tmp/logilab-common-0.57.0/usr/lib64/python3.2/site-packages/logilab/common/testlib.py", line 3 75, in _handleModuleFixture previousModule = self._get_previous_module(result) TypeError: _get_previous_module() takes exactly 2 arguments (1 given) | |
priority | normal |
---|---|
type | bug |
done in | 0.57.1 |
load left | 0.000 |
closed by | #091a372460a9 [compat] use instance of the class to have a real instance method (closes: #79268) |
Comments
-
2011/10/19 14:07, written by acampeas
-
2011/10/19 14:22, written by anon
-
2011/10/19 14:28, written by acampeas
-
2011/10/19 15:13, written by anon
add commentI'am asking: WHO is currently using lgc with python 3 and FOR WHAT ?
Genuine question. This is a user survey. You can even skip the WHO part.
logilab-common is used by pylint, which can be used to analyze Python-3-only code.
ohhh ... pylint is py3k compliant ?
ChangeLog of pylint says that support for Python 3 has been finalized since 0.23.0.