summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-06-06 11:34:33 (GMT)
committerThomas Heller <theller@ctypes.org>2006-06-06 11:34:33 (GMT)
commitecc3e67b986a1eed404b528ccbc099049c149edb (patch)
treedbb45566cd40d8fc0fd30c79217f8867d82b4840 /Lib
parentdd2a6bf14f5a0794c14780af72641177f216ee01 (diff)
downloadcpython-ecc3e67b986a1eed404b528ccbc099049c149edb.zip
cpython-ecc3e67b986a1eed404b528ccbc099049c149edb.tar.gz
cpython-ecc3e67b986a1eed404b528ccbc099049c149edb.tar.bz2
Convert CFieldObject tp_members to tp_getset, since there is no
structmember typecode for Py_ssize_t fields. This should fix some of the errors on the PPC64 debian machine (64-bit, big endian). Assigning to readonly fields now raises AttributeError instead of TypeError, so the testcase has to be changed as well.
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 5340f79..49f064b 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -138,8 +138,8 @@ class StructureTestCase(unittest.TestCase):
self.failUnlessEqual(X.y.size, sizeof(c_char))
# readonly
- self.assertRaises(TypeError, setattr, X.x, "offset", 92)
- self.assertRaises(TypeError, setattr, X.x, "size", 92)
+ self.assertRaises(AttributeError, setattr, X.x, "offset", 92)
+ self.assertRaises(AttributeError, setattr, X.x, "size", 92)
class X(Union):
_fields_ = [("x", c_int),
@@ -152,8 +152,8 @@ class StructureTestCase(unittest.TestCase):
self.failUnlessEqual(X.y.size, sizeof(c_char))
# readonly
- self.assertRaises(TypeError, setattr, X.x, "offset", 92)
- self.assertRaises(TypeError, setattr, X.x, "size", 92)
+ self.assertRaises(AttributeError, setattr, X.x, "offset", 92)
+ self.assertRaises(AttributeError, setattr, X.x, "size", 92)
# XXX Should we check nested data types also?
# offset is always relative to the class...