diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-02-10 15:46:50 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-02-10 15:46:50 (GMT) |
commit | 4015f62e39452db0aa651edcd54b00f4e80e6bb5 (patch) | |
tree | f9d290763c2e993c0465d51a5f70387ff0598ccf /Lib | |
parent | 6a743d3694fb5138f5eab393c172c3b6789b0383 (diff) | |
download | cpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.zip cpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.tar.gz cpython-4015f62e39452db0aa651edcd54b00f4e80e6bb5.tar.bz2 |
Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments. Previously, it raised TypeError.
Thanks Lisandro Dalcin.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_struct.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 7f5f08b..a4dc9ca 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -48,7 +48,7 @@ def with_warning_restore(func): def deprecated_err(func, *args): try: func(*args) - except (struct.error, TypeError): + except (struct.error, OverflowError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: @@ -185,7 +185,7 @@ class StructTest(unittest.TestCase): def test_native_qQ(self): # can't pack -1 as unsigned regardless - self.assertRaises((struct.error, TypeError), struct.pack, "Q", -1) + self.assertRaises((struct.error, OverflowError), struct.pack, "Q", -1) # can't pack string as 'q' regardless self.assertRaises(struct.error, struct.pack, "q", "a") # ditto, but 'Q' |