diff Lib/test/test_struct.py @ 51517:20609fc13a13 legacy-trunk

Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin.
author Mark Dickinson <dickinsm@gmail.com>
date Tue, 10 Feb 2009 15:46:50 +0000
parents df3923c36ec5
children bf419cfd7b0a
line wrap: on
line diff
--- a/Lib/test/test_struct.py	Tue Feb 10 13:32:24 2009 +0000
+++ b/Lib/test/test_struct.py	Tue Feb 10 15:46:50 2009 +0000
@@ -48,7 +48,7 @@
 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 @@
 
     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'