]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport gvanrossum's patch:
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 18 Apr 2002 05:10:58 +0000 (05:10 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 18 Apr 2002 05:10:58 +0000 (05:10 +0000)
SF bug #541883 (Vincent Fiack).

A stupid bug in object_set_class(): didn't check for value==NULL
before checking its type.

Bugfix candidate.

Original patches were:
python/dist/src/Lib/test/test_descr.py:1.129

Lib/test/test_descr.py

index 2a48f12782aff0221d5867546f6585db4f453d49..ded362ee201c56ac62092603ed376dd0d1fb59b3 100644 (file)
@@ -2324,6 +2324,12 @@ def setclass():
             pass
         else:
             raise TestFailed, "shouldn't allow %r.__class__ = %r" % (x, C)
+        try:
+            delattr(x, "__class__")
+        except TypeError:
+            pass
+        else:
+            raise TestFailed, "shouldn't allow del %r.__class__" % x
     cant(C(), list)
     cant(list(), C)
     cant(C(), 1)