diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2001-03-22 15:51:28 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2001-03-22 15:51:28 (GMT) |
commit | 17741be4667004a38c912c3fdca00cff19a5c4e4 (patch) | |
tree | 899c8c2e047bdaad911b2493f4b4abaa8ddde446 /Lib | |
parent | b25e1ad253a4d96aea31a7a3fb78522ea354f43a (diff) | |
download | cpython-17741be4667004a38c912c3fdca00cff19a5c4e4.zip cpython-17741be4667004a38c912c3fdca00cff19a5c4e4.tar.gz cpython-17741be4667004a38c912c3fdca00cff19a5c4e4.tar.bz2 |
SRE 2.1b1: don't do unicode tests under 1.5.2, or on unicode
strings/patterns.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_re.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 2552857..f4c5cb8 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. |