Fix for SF bug 532646. This is a little simpler than what Neal

suggested there, based upon a better analysis (__getattr__ is a red
herring).  Will backport to 2.2.
This commit is contained in:
Guido van Rossum 2002-06-13 21:32:51 +00:00
parent 51290d369d
commit 16b93b3d0e
2 changed files with 31 additions and 1 deletions

View file

@ -274,3 +274,17 @@ def __eq__(self, other): return 1
try: hash(C2())
except TypeError: pass
else: raise TestFailed, "hash(C2()) should raise an exception"
# Test for SF bug 532646
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?"