mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
SF bug #541883 (Vincent Fiack).
A stupid bug in object_set_class(): didn't check for value==NULL before checking its type. Bugfix candidate.
This commit is contained in:
parent
d1c08f33f2
commit
b6b8942f53
2 changed files with 11 additions and 0 deletions
|
|
@ -2352,6 +2352,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue