From 21776074cc300dbdea412aa57cb6efdd126dcff6 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Tue, 10 Feb 2009 16:13:25 +0000 Subject: Merged revisions 69498 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r69498 | mark.dickinson | 2009-02-10 15:46:50 +0000 (Tue, 10 Feb 2009) | 6 lines Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. ........ --- Lib/test/test_struct.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_struct.py') diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index bdbc397415c..2bc92f3b394 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: @@ -191,7 +191,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' -- cgit v1.2.3