diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 2552857ab87..f4c5cb88915 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -336,9 +336,14 @@ def bump_num(matchobj): # Try the match on a unicode string, and check that it # still succeeds. - result = obj.search(unicode(s, "latin-1")) - if result is None: - print '=== Fails on unicode match', t + try: + result = obj.search(unicode(s, "latin-1")) + if result is None: + print '=== Fails on unicode match', t + except NameError: + continue # 1.5.2 + except TypeError: + continue # unicode test case # Try the match on a unicode pattern, and check that it # still succeeds.