[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) Fix test_bytes when sys.stdin is None, for example on Windows when

victor.stinner python-checkins at python.org
Tue Jul 29 00:08:18 CEST 2014


http://hg.python.org/cpython/rev/ed308c4c72f0
changeset:   91906:ed308c4c72f0
parent:      91903:8c1438c15ed0
parent:      91904:a1e01081e731
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Jul 29 00:07:56 2014 +0200
summary:
  (Merge 3.4) Fix test_bytes when sys.stdin is None, for example on Windows when
using pythonw.exe instead of python.exe

files:
  Lib/test/test_bytes.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -700,7 +700,7 @@
     type2test = bytes
 
     def test_buffer_is_readonly(self):
-        fd = os.dup(sys.stdin.fileno())
+        fd = os.open(__file__, os.O_RDONLY)
         with open(fd, "rb", buffering=0) as f:
             self.assertRaises(TypeError, f.readinto, b"")
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list