summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2008-01-16 19:45:51 (GMT)
committerThomas Heller <theller@ctypes.org>2008-01-16 19:45:51 (GMT)
commit415c1e36a9f3cb119fad8aa5fcdcc9f31284782e (patch)
tree39db49aa09e4dc2cff313097c656af4414320143 /Lib
parent02ec289f3e16ee6b00ecf7ec8f8e0f2a3e1ad152 (diff)
downloadcpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.zip
cpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.tar.gz
cpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.tar.bz2
Raise a TypeError instead of a ValueError when too many initializers
are used in a Structure or Union constructor.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_structures.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 3005e82..0c5a347 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -222,8 +222,8 @@ class StructureTestCase(unittest.TestCase):
self.assertRaises(TypeError, POINT, 2, 3, x=4)
self.assertRaises(TypeError, POINT, 2, 3, y=4)
- # Should this raise TypeError instead?
- self.assertRaises(ValueError, POINT, 2, 3, 4)
+ # too many initializers
+ self.assertRaises(TypeError, POINT, 2, 3, 4)
def test_keyword_initializers(self):
class POINT(Structure):
@@ -320,9 +320,9 @@ class StructureTestCase(unittest.TestCase):
self.failUnlessEqual(cls, RuntimeError)
if issubclass(Exception, object):
self.failUnlessEqual(msg,
- "(Phone) <type 'exceptions.ValueError'>: too many initializers")
+ "(Phone) <type 'exceptions.TypeError'>: too many initializers")
else:
- self.failUnlessEqual(msg, "(Phone) exceptions.ValueError: too many initializers")
+ self.failUnlessEqual(msg, "(Phone) exceptions.TypeError: too many initializers")
def get_except(self, func, *args):