[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.107,1.108

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 04 Dec 2001 08:23:45 -0800


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

Modified Files:
	test_descr.py 
Log Message:
Fix SF bug #486144: Uninitialized __slot__ vrbl is None.

There's now a new structmember code, T_OBJECT_EX, which is used for
all __slot__ variables (except __weakref__, which has special behavior
anyway).  This new code raises AttributeError when the variable is
NULL rather than converting NULL to None.



Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** test_descr.py	2001/12/03 16:32:17	1.107
--- test_descr.py	2001/12/04 16:23:42	1.108
***************
*** 979,987 ****
      x = C1()
      verify(not hasattr(x, "__dict__"))
!     vereq(x.a, None)
      x.a = 1
      vereq(x.a, 1)
      del x.a
!     vereq(x.a, None)
  
      class C3(object):
--- 979,989 ----
      x = C1()
      verify(not hasattr(x, "__dict__"))
!     verify(not hasattr(x, "a"))
      x.a = 1
      vereq(x.a, 1)
+     x.a = None
+     veris(x.a, None)
      del x.a
!     verify(not hasattr(x, "a"))
  
      class C3(object):
***************
*** 989,995 ****
      x = C3()
      verify(not hasattr(x, "__dict__"))
!     verify(x.a is None)
!     verify(x.b is None)
!     verify(x.c is None)
      x.a = 1
      x.b = 2
--- 991,997 ----
      x = C3()
      verify(not hasattr(x, "__dict__"))
!     verify(not hasattr(x, 'a'))
!     verify(not hasattr(x, 'b'))
!     verify(not hasattr(x, 'c'))
      x.a = 1
      x.b = 2