Commits

Brian Kearns committed a15262b

silence KeyError when global_storage.clear() is called before __del__

  • Participants
  • Parent commits 8894a48

Comments (0)

Files changed (1)

File pypy/module/pyexpat/interp_pyexpat.py

         if XML_ParserFree: # careful with CPython interpreter shutdown
             XML_ParserFree(self.itself)
         if global_storage:
-            global_storage.free_nonmoving_id(self.id)
+            try:
+                global_storage.free_nonmoving_id(self.id)
+            except KeyError:
+                pass    # maybe global_storage.clear() was already called
 
     @unwrap_spec(flag=int)
     def SetParamEntityParsing(self, space, flag):