[pypy-svn] pypy default: Avoid warning messages when the test suite finishes:

amauryfa commits-noreply at bitbucket.org
Thu Feb 17 00:42:24 CET 2011

Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Changeset: r42093:d52d8b46fe48
Date: 2011-02-17 00:42 +0100

Log:	Avoid warning messages when the test suite finishes: Exception
	AttributeError: "'NoneType' object has no attribute
	'nested_hash_level'" ignored

diff --git a/pypy/rpython/lltypesystem/lltype.py b/pypy/rpython/lltypesystem/lltype.py
--- a/pypy/rpython/lltypesystem/lltype.py
+++ b/pypy/rpython/lltypesystem/lltype.py
@@ -21,6 +21,8 @@
         weakref.WeakValueDictionary.__init__(self, *args, **kwargs)
         remove_base = self._remove
         def remove(*args):
+            if TLS is None: # Happens when the interpreter is shutting down
+                return remove_base(*args)
             nested_hash_level = TLS.nested_hash_level
                 # The 'remove' function is called when an object dies.  This

More information about the Pypy-commit mailing list