Re: [Python-Dev] possible fix for recursive __call__ segfault

2006-04-18 Thread Armin Rigo
Hi Brett, On Mon, Apr 17, 2006 at 05:34:16PM -0700, Brett Cannon wrote: + if (meth == self) { + PyErr_SetString(PyExc_RuntimeError, + recursive __call__ definition); + return NULL; + } This is not the proper way, as it

Re: [Python-Dev] possible fix for recursive __call__ segfault

2006-04-18 Thread Brett Cannon
On 4/18/06, Armin Rigo [EMAIL PROTECTED] wrote: Hi Brett, On Mon, Apr 17, 2006 at 05:34:16PM -0700, Brett Cannon wrote: + if (meth == self) { + PyErr_SetString(PyExc_RuntimeError, + recursive __call__ definition); + return

[Python-Dev] possible fix for recursive __call__ segfault

2006-04-17 Thread Brett Cannon
Bug 532646 is a check for recursive __call__ methods where it is just set to an instance of the same class:: class A: pass A.__call__ = A() a = A() try: a() # This should not segfault except RuntimeError: pass else: raise TestFailed, how could this not have overflowed the stack?