summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_class.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-06-13 21:32:51 (GMT)
committerGuido van Rossum <guido@python.org>2002-06-13 21:32:51 (GMT)
commit16b93b3d0e2bf8dc22d11e8625af6d9cc913ec88 (patch)
tree630dc03abb467a5e3cac738bff939d0c80fb2db9 /Lib/test/test_class.py
parent51290d369d7ef7bc9dec6a0082e3aa4f5e434d31 (diff)
downloadcpython-16b93b3d0e2bf8dc22d11e8625af6d9cc913ec88.zip
cpython-16b93b3d0e2bf8dc22d11e8625af6d9cc913ec88.tar.gz
cpython-16b93b3d0e2bf8dc22d11e8625af6d9cc913ec88.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_class.py')
-rw-r--r--Lib/test/test_class.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index 151074e..5240b3a 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -274,3 +274,17 @@ class C2:
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?"