diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-07-21 16:53:04 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-07-21 16:53:04 (GMT) |
commit | 913c52edf31d2f14d076f5e3e7218d09a0934f4d (patch) | |
tree | e1dba9b4343523089b4ee3da7caae21dd56fa7c5 /Lib | |
parent | 86c590e64a734d8c13382fa92c34594d90d4fc5a (diff) | |
download | cpython-913c52edf31d2f14d076f5e3e7218d09a0934f4d.zip cpython-913c52edf31d2f14d076f5e3e7218d09a0934f4d.tar.gz cpython-913c52edf31d2f14d076f5e3e7218d09a0934f4d.tar.bz2 |
Merged revisions 83030 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83030 | antoine.pitrou | 2010-07-21 18:41:31 +0200 (mer., 21 juil. 2010) | 5 lines
Issue #5395: check that array.fromfile() re-raises an IOError instead of replacing it
with EOFError.
(this is only an added test, but 2.x will get a fix too)
........
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/test/test_array.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index dd01574..4cac68b 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -182,6 +182,17 @@ class BaseTest(unittest.TestCase): f.close() support.unlink(support.TESTFN) + def test_fromfile_ioerror(self): + # Issue #5395: Check if fromfile raises a proper IOError + # instead of EOFError. + a = array.array(self.typecode) + f = open(support.TESTFN, 'wb') + try: + self.assertRaises(IOError, a.fromfile, f, len(self.example)) + finally: + f.close() + support.unlink(support.TESTFN) + def test_tofromlist(self): a = array.array(self.typecode, 2*self.example) b = array.array(self.typecode) |