]> granicus.if.org Git - python/commitdiff
Make test_re pass.
authorGuido van Rossum <guido@python.org>
Tue, 15 May 2007 21:39:58 +0000 (21:39 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 15 May 2007 21:39:58 +0000 (21:39 +0000)
Lib/test/test_re.py

index b6dfea8155dead0165f062a9e547e4dcc08a386a..1f4505ff967d9b2a8117dcafdb2335650220d663 100644 (file)
@@ -560,10 +560,6 @@ class ReTests(unittest.TestCase):
 
     def test_bug_764548(self):
         # bug 764548, re.compile() barfs on str/unicode subclasses
-        try:
-            str
-        except NameError:
-            return  # no problem if we have no unicode
         class my_unicode(str): pass
         pat = re.compile(my_unicode("abc"))
         self.assertEqual(pat.match("xyz"), None)
@@ -574,19 +570,11 @@ class ReTests(unittest.TestCase):
                          [":", "::", ":::"])
 
     def test_bug_926075(self):
-        try:
-            str
-        except NameError:
-            return # no problem if we have no unicode
         self.assert_(re.compile('bug_926075') is not
-                     re.compile(eval("u'bug_926075'")))
+                     re.compile(str8('bug_926075')))
 
     def test_bug_931848(self):
-        try:
-            str
-        except NameError:
-            pass
-        pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
+        pattern = eval('"[\u002E\u3002\uFF0E\uFF61]"')
         self.assertEqual(re.compile(pattern).split("a.b.c"),
                          ['a','b','c'])