Author: Wim Lavrijsen <wlavrij...@lbl.gov> Branch: reflex-support Changeset: r53276:d905100df05f Date: 2012-03-08 10:50 -0800 http://bitbucket.org/pypy/pypy/changeset/d905100df05f/
Log: lazy setup of function returns to prevent hitting the recursion limits when class return types are created diff --git a/pypy/module/cppyy/pythonify.py b/pypy/module/cppyy/pythonify.py --- a/pypy/module/cppyy/pythonify.py +++ b/pypy/module/cppyy/pythonify.py @@ -46,22 +46,22 @@ def make_static_function(cpptype, func_name, cppol): rettype = cppol.get_returntype() if not rettype: # return builtin type - cppclass = None + def function(*args): + return cppol.call(None, None, *args) else: # return instance - cppclass = get_cppclass(rettype) - def function(*args): - return cppol.call(None, cppclass, *args) + def function(*args): + return cppol.call(None, get_cppclass(rettype), *args) function.__name__ = func_name return staticmethod(function) def make_method(meth_name, cppol): rettype = cppol.get_returntype() if not rettype: # return builtin type - cppclass = None + def method(self, *args): + return cppol.call(self, None, *args) else: # return instance - cppclass = get_cppclass(rettype) - def method(self, *args): - return cppol.call(self, cppclass, *args) + def method(self, *args): + return cppol.call(self, get_cppclass(rettype), *args) method.__name__ = meth_name return method _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit