[Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.12,1.113.4.13

anthonybaxter@sourceforge.net anthonybaxter@sourceforge.net
Wed, 17 Apr 2002 22:11:00 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv11705/Lib/test

Modified Files:
      Tag: release22-maint
	test_descr.py 
Log Message:
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



Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113.4.12
retrieving revision 1.113.4.13
diff -C2 -d -r1.113.4.12 -r1.113.4.13
*** test_descr.py	18 Apr 2002 04:46:49 -0000	1.113.4.12
--- test_descr.py	18 Apr 2002 05:10:58 -0000	1.113.4.13
***************
*** 2325,2328 ****
--- 2325,2334 ----
          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)