From: Fredrik Lundh Date: Thu, 22 Mar 2001 15:51:28 +0000 (+0000) Subject: SRE 2.1b1: don't do unicode tests under 1.5.2, or on unicode X-Git-Tag: v2.1b2~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17741be4667004a38c912c3fdca00cff19a5c4e4;p=thirdparty%2FPython%2Fcpython.git SRE 2.1b1: don't do unicode tests under 1.5.2, or on unicode strings/patterns. --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 2552857ab87d..f4c5cb889151 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -336,9 +336,14 @@ for t in tests: # 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.