summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 50d7ed4..f724806 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -474,6 +474,16 @@ class ReTests(unittest.TestCase):
self.assertEqual(re.match('(a)((?!(b)*))*', 'abb').groups(),
('a', None, None))
+ def test_bug_764548(self):
+ # bug 764548, re.compile() barfs on str/unicode subclasses
+ try:
+ unicode
+ except NameError:
+ return # no problem if we have no unicode
+ class my_unicode(unicode): pass
+ pat = re.compile(my_unicode("abc"))
+ self.assertEqual(pat.match("xyz"), None)
+
def test_finditer(self):
iter = re.finditer(r":+", "a:b::c:::d")
self.assertEqual([item.group(0) for item in iter],