From: Anthony Baxter Date: Thu, 18 Apr 2002 05:10:58 +0000 (+0000) Subject: backport gvanrossum's patch: X-Git-Tag: v2.2.2b1~431 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3de8a96217d9ef80ac4eb196729eb14f3f638610;p=thirdparty%2FPython%2Fcpython.git backport gvanrossum's patch: 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 --- diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 2a48f12782af..ded362ee201c 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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)