From: Hye-Shik Chang Date: Tue, 20 Apr 2004 21:30:07 +0000 (+0000) Subject: SF #926075: Fixed the bug that returns a wrong pattern object for X-Git-Tag: v2.4a1~482 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f62eccb6657abd5c6a4a4694e6fe8c80f8ccb12;p=thirdparty%2FPython%2Fcpython.git SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 6ceab6de3bca..9edca6eb9701 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -489,6 +489,14 @@ class ReTests(unittest.TestCase): self.assertEqual([item.group(0) for item in iter], [":", "::", ":::"]) + def test_bug_926075(self): + try: + unicode + except NameError: + return # no problem if we have no unicode + self.assert_(re.compile('bug_926075') is not + re.compile(eval("u'bug_926075'"))) + def run_re_tests(): from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR if verbose: