Author: Armin Rigo <[email protected]>
Branch: gc-del
Changeset: r63642:9aba857627db
Date: 2013-04-26 15:04 +0200
http://bitbucket.org/pypy/pypy/changeset/9aba857627db/

Log:    haaaack to stop complaining at interpreter exit

diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -277,8 +277,14 @@
 _finalizer_lock = [None]
 
 class _UntranslatedFinalizingObject(object):
+    import sys
     call_finalizer = None
     def __del__(self):
+        # haaaaaaaaaaaaaaack
+        try:
+            self.sys._getframe(1)
+        except ValueError:     # 'call stack is not deep enough'
+            return  # ignore, very likely called when shutting down
         g = object.__new__(self.original_class)
         g.__dict__ = self.dict
         _finalizer_queue.append((g, self.func))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to