Kaydet (Commit) 98a379ed authored tarafından Neal Norwitz's avatar Neal Norwitz

Add test for bug #751998.

üst b47243ae
......@@ -1267,6 +1267,22 @@ def slots():
g==g
new_objects = len(gc.get_objects())
vereq(orig_objects, new_objects)
class H(object):
__slots__ = ['a', 'b']
def __init__(self):
self.a = 1
self.b = 2
def __del__(self):
assert self.a == 1
assert self.b == 2
save_stderr = sys.stderr
sys.stderr = sys.stdout
h = H()
try:
del h
finally:
sys.stderr = save_stderr
def slotspecials():
if verbose: print "Testing __dict__ and __weakref__ in __slots__..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment