[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>
Branch: 
Changeset: r42093:d52d8b46fe48
Date: 2011-02-17 00:42 +0100
http://bitbucket.org/pypy/pypy/changeset/d52d8b46fe48/

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
             try:
                 # The 'remove' function is called when an object dies.  This


More information about the Pypy-commit mailing list