Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_struct.py @ 81039:7d69d04522e3
Replace IOError with OSError (#16715)
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Tue, 25 Dec 2012 16:47:37 +0200 |
| parents | d43ff8eb4cb3 |
| children | d232cff25bbd |
line wrap: on
line diff
--- a/Lib/test/test_struct.py Tue Dec 25 15:47:41 2012 +0200 +++ b/Lib/test/test_struct.py Tue Dec 25 16:47:37 2012 +0200 @@ -489,7 +489,7 @@ def test_bool(self): class ExplodingBool(object): def __bool__(self): - raise IOError + raise OSError for prefix in tuple("<>!=")+('',): false = (), [], [], '', 0 true = [1], 'test', 5, -1, 0xffffffff+1, 0xffffffff/2 @@ -520,10 +520,10 @@ try: struct.pack(prefix + '?', ExplodingBool()) - except IOError: + except OSError: pass else: - self.fail("Expected IOError: struct.pack(%r, " + self.fail("Expected OSError: struct.pack(%r, " "ExplodingBool())" % (prefix + '?')) for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
