other places like this just catch IOError
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index b2d17e9..3fd1afe 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -1438,7 +1438,7 @@
     def close(self):
         try:
             self.flush()
-        except:
+        except IOError:
             pass  # If flush() fails, just give up
         self.buffer.close()