Author: Philip Jenvey <[email protected]>
Branch: 
Changeset: r62410:58a5238702ca
Date: 2013-03-18 14:57 -0700
http://bitbucket.org/pypy/pypy/changeset/58a5238702ca/

Log:    we may have already been removed w/ daemon threads & sys.exit. this
        is diffcult to test

diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py
--- a/pypy/module/_io/interp_iobase.py
+++ b/pypy/module/_io/interp_iobase.py
@@ -350,7 +350,11 @@
     def remove(self, w_iobase):
         holder = w_iobase.streamholder
         if holder is not None:
-            del self.streams[holder]
+            try:
+                del self.streams[holder]
+            except KeyError:
+                # this can happen in daemon threads
+                pass
 
     def flush_all(self, space):
         while self.streams:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to