diff options
Diffstat (limited to 'Lib/test/crashers/weakref_in_del.py')
-rw-r--r-- | Lib/test/crashers/weakref_in_del.py | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Lib/test/crashers/weakref_in_del.py b/Lib/test/crashers/weakref_in_del.py index d00937f..5c8ca15 100644 --- a/Lib/test/crashers/weakref_in_del.py +++ b/Lib/test/crashers/weakref_in_del.py @@ -1,17 +1,16 @@ -import weakref - -# http://python.org/sf/1377858 - -ref = None - -def test_weakref_in_del(): - class Target(object): - def __del__(self): - global ref - ref = weakref.ref(self) - - w = Target() - -if __name__ == '__main__': - test_weakref_in_del() - +import weakref
+
+# http://python.org/sf/1377858
+
+ref = None
+
+def test_weakref_in_del():
+ class Target(object):
+ def __del__(self):
+ global ref
+ ref = weakref.ref(self)
+
+ w = Target()
+
+if __name__ == '__main__':
+ test_weakref_in_del()
|