]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Simple fixes.
authorThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 19:42:59 +0000 (19:42 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 19:42:59 +0000 (19:42 +0000)
Lib/ctypes/test/test_repr.py
Lib/ctypes/test/test_structures.py

index f6f93666502516dd0f8b8b7e277a605e95a0ca64..383082f83187c84585dd0aaf62101860808ccafe 100644 (file)
@@ -22,7 +22,7 @@ class ReprTest(unittest.TestCase):
             self.failUnlessEqual("<X object at", repr(typ(42))[:12])
 
     def test_char(self):
-        self.failUnlessEqual("c_char('x')", repr(c_char('x')))
+        self.failUnlessEqual("c_char(s'x')", repr(c_char('x')))
         self.failUnlessEqual("<X object at", repr(X('x'))[:12])
 
 if __name__ == "__main__":
index ab98a66b9036b6a2b190ad86cae1666523dc84cd..0aa4aea4308810d9ce120bc14dce6324c9205afc 100644 (file)
@@ -291,15 +291,9 @@ class StructureTestCase(unittest.TestCase):
 
         cls, msg = self.get_except(Person, "Someone", (1, 2))
         self.failUnlessEqual(cls, RuntimeError)
-        # In Python 2.5, Exception is a new-style class, and the repr changed
-        if issubclass(Exception, object):
-            self.failUnlessEqual(msg,
-                                 "(Phone) <type 'TypeError'>: "
-                                 "expected string or Unicode object, int found")
-        else:
-            self.failUnlessEqual(msg,
-                                 "(Phone) TypeError: "
-                                 "expected string or Unicode object, int found")
+        self.failUnlessEqual(msg,
+                             "(Phone) <type 'TypeError'>: "
+                             "expected string, int found")
 
         cls, msg = self.get_except(Person, "Someone", ("a", "b", "c"))
         self.failUnlessEqual(cls, RuntimeError)