[pypy-commit] pypy default: Oups. test_weakref shows that this is needed.

arigo noreply at buildbot.pypy.org
Fri Jul 15 13:40:00 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45619:d7287648ee0d
Date: 2011-07-15 13:39 +0200
http://bitbucket.org/pypy/pypy/changeset/d7287648ee0d/

Log:	Oups. test_weakref shows that this is needed.

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -145,11 +145,11 @@
     def __del__(self):
         # Only bother enqueuing self to raise an exception if the frame is
         # still not finished and finally or except blocks are present.
+        self.clear_all_weakrefs()
         if self.frame is not None:
             block = self.frame.lastblock
             while block is not None:
                 if not isinstance(block, LoopBlock):
-                    self.clear_all_weakrefs()
                     self.enqueue_for_destruction(self.space,
                                                  GeneratorIterator.descr_close,
                                                  "interrupting generator of ")


More information about the pypy-commit mailing list