From 3de8a96217d9ef80ac4eb196729eb14f3f638610 Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Thu, 18 Apr 2002 05:10:58 +0000 Subject: [PATCH] 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 --- Lib/test/test_descr.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.47.3