summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-19 00:08:08 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-19 00:08:08 (GMT)
commit5848d1ff35f8606b1678ff8cc29011b8fd4ef486 (patch)
treed1607015545ad0de2967543397e0e33d9ee5d81e /Lib
parentb6e112bd952c2023b95212364ed07ad9c235da41 (diff)
downloadcpython-5848d1ff35f8606b1678ff8cc29011b8fd4ef486.zip
cpython-5848d1ff35f8606b1678ff8cc29011b8fd4ef486.tar.gz
cpython-5848d1ff35f8606b1678ff8cc29011b8fd4ef486.tar.bz2
raise an OSError for invalid fds #4991
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_fileio.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index d8cf415..c089608 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -176,6 +176,10 @@ class OtherFileTests(unittest.TestCase):
f.close()
os.unlink(TESTFN)
+ def testInvalidFd(self):
+ self.assertRaises(ValueError, _fileio._FileIO, -10)
+ self.assertRaises(OSError, _fileio._FileIO, 10)
+
def testBadModeArgument(self):
# verify that we get a sensible error message for bad mode argument
bad_mode = "qwerty"