Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 535a5ef

Browse files
committed
Fix test_file.py. It was passing on OSX for the wrong reason
(somehow OSX marks I/O devices as seekable).
1 parent 558ca84 commit 535a5ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ def testModeStrings(self):
140140
def testStdin(self):
141141
# This causes the interpreter to exit on OSF1 v5.1.
142142
if sys.platform != 'osf1V5':
143-
self.assertRaises(ValueError, sys.stdin.seek, -1)
143+
self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
144144
else:
145145
print((
146146
' Skipping sys.stdin.seek(-1), it may crash the interpreter.'
147147
' Test manually.'), file=sys.__stdout__)
148-
self.assertRaises(ValueError, sys.stdin.truncate)
148+
self.assertRaises((IOError, ValueError), sys.stdin.truncate)
149149

150150
def testBadModeArgument(self):
151151
# verify that we get a sensible error message for bad mode argument

0 commit comments

Comments
 (0)