summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-04-20 21:30:07 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-04-20 21:30:07 (GMT)
commit9f62eccb6657abd5c6a4a4694e6fe8c80f8ccb12 (patch)
treef2dcc863d306ce792aa44fc639b9451b7d619f06 /Lib
parent0f5bf1ebdd426fb17f92d00b319a55b014021c30 (diff)
downloadcpython-9f62eccb6657abd5c6a4a4694e6fe8c80f8ccb12.zip
cpython-9f62eccb6657abd5c6a4a4694e6fe8c80f8ccb12.tar.gz
cpython-9f62eccb6657abd5c6a4a4694e6fe8c80f8ccb12.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 6ceab6d..9edca6e 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: