Antoine Pitrou <pit...@free.fr> added the comment:

+            raw = f
+            if hasattr(raw, 'buffer'):
+                raw = raw.buffer
+            if hasattr(raw, 'raw'):
+                raw = raw.raw
             f.close()
             self.assertRaises(ValueError, f.flush)
             self.assertRaises(ValueError, f.fileno)
@@ -2512,6 +2517,7 @@ class MiscIOTest(unittest.TestCase):
             self.assertRaises(ValueError, f.read)
             if hasattr(f, "read1"):
                 self.assertRaises(ValueError, f.read1, 1024)
+            self.assertRaises(ValueError, raw.readall)

Why not simply:

             if hasattr(f, "readall"):
                 self.assertRaises(ValueError, f.readall, 1024)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12175>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to