summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sre.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-01-16 07:37:30 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2001-01-16 07:37:30 (GMT)
commit1c5aa6901fb13f8112ead1786868f0f8ed4c9e2d (patch)
tree52a6a1c66be3f2ea6c8f73e13d87412fe7d8bea7 /Lib/test/test_sre.py
parentdfb673b45730635a386ceb3e2405bf2809a2e40c (diff)
downloadcpython-1c5aa6901fb13f8112ead1786868f0f8ed4c9e2d.zip
cpython-1c5aa6901fb13f8112ead1786868f0f8ed4c9e2d.tar.gz
cpython-1c5aa6901fb13f8112ead1786868f0f8ed4c9e2d.tar.bz2
bumped SRE version number to 2.1. cleaned up and added 1.5.2
compatibility patches.
Diffstat (limited to 'Lib/test/test_sre.py')
-rw-r--r--Lib/test/test_sre.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py
index 5d19d40..88c0d62 100644
--- a/Lib/test/test_sre.py
+++ b/Lib/test/test_sre.py
@@ -325,16 +325,26 @@ 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==None:
- print '=== Fails on unicode match', t
+ try:
+ u = unicode(s, "latin-1")
+ except NameError:
+ pass
+ else:
+ result=obj.search(u)
+ if result==None:
+ print '=== Fails on unicode match', t
# Try the match on a unicode pattern, and check that it
# still succeeds.
- obj=sre.compile(unicode(pattern, "latin-1"))
- result=obj.search(s)
- if result==None:
- print '=== Fails on unicode pattern match', t
+ try:
+ u = unicode(pattern, "latin-1")
+ except NameError:
+ pass
+ else:
+ obj=sre.compile(u)
+ result=obj.search(s)
+ if result==None:
+ print '=== Fails on unicode pattern match', t
# Try the match with the search area limited to the extent
# of the match and see if it still succeeds. \B will