# HG changeset patch # User Julien Cristau # Date 1443693042 -7200 # Node ID 1166a47dad40b8636a22df74b8eca9369e4bc526 # Parent 2703116e4b210ca2449d18325928e2573b466a5f [web/ajax] fix AjaxController on python3 diff -r 2703116e4b21 -r 1166a47dad40 web/views/ajaxcontroller.py --- a/web/views/ajaxcontroller.py Thu Oct 01 11:50:09 2015 +0200 +++ b/web/views/ajaxcontroller.py Thu Oct 01 11:50:42 2015 +0200 @@ -66,7 +66,7 @@ from warnings import warn from functools import partial -from six import text_type +from six import PY2, text_type from logilab.common.date import strptime from logilab.common.registry import yes @@ -119,7 +119,9 @@ raise RemoteCallFailed('no method specified') # 1/ check first for old-style (JSonController) ajax func for bw compat try: - func = getattr(basecontrollers.JSonController, 'js_%s' % fname).im_func + func = getattr(basecontrollers.JSonController, 'js_%s' % fname) + if PY2: + func = func.__func__ func = partial(func, self) except AttributeError: # 2/ check for new-style (AjaxController) ajax func