diff options
author | Thomas Heller <theller@ctypes.org> | 2006-08-16 14:07:44 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2006-08-16 14:07:44 (GMT) |
commit | b0aa98fd4f02c4d5a9d9f43ac013595cbcf1f06c (patch) | |
tree | b88f01ec6c8e4e8bdcca75bc0562537b124b47cf /Lib/ctypes/test | |
parent | 596fc9c3848d48b2393f6871d1b77befe8b4ffbd (diff) | |
download | cpython-b0aa98fd4f02c4d5a9d9f43ac013595cbcf1f06c.zip cpython-b0aa98fd4f02c4d5a9d9f43ac013595cbcf1f06c.tar.gz cpython-b0aa98fd4f02c4d5a9d9f43ac013595cbcf1f06c.tar.bz2 |
The __repr__ method of a NULL py_object does no longer raise an
exception. Remove a stray '?' character from the exception text
when the value is retrieved of such an object.
Includes tests.
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r-- | Lib/ctypes/test/test_python_api.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py index 78e0231..9d13474 100644 --- a/Lib/ctypes/test/test_python_api.py +++ b/Lib/ctypes/test/test_python_api.py @@ -78,5 +78,10 @@ class PythonAPITestCase(unittest.TestCase): # not enough arguments self.failUnlessRaises(TypeError, PyOS_snprintf, buf) + def test_pyobject_repr(self): + self.failUnlessEqual(repr(py_object()), "py_object(<NULL>)") + self.failUnlessEqual(repr(py_object(42)), "py_object(42)") + self.failUnlessEqual(repr(py_object(object)), "py_object(%r)" % object) + if __name__ == "__main__": unittest.main() |