summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-09-03 08:15:19 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-09-03 08:15:19 (GMT)
commitacee48628d6df976170c289227def0644cf2dbf5 (patch)
treeda1a8cc893ee0396f76b6d3ce938124cdf3d32db /Lib
parent6ebd299cee42f26921b45eb8d5259f016ddf3553 (diff)
downloadcpython-acee48628d6df976170c289227def0644cf2dbf5.zip
cpython-acee48628d6df976170c289227def0644cf2dbf5.tar.gz
cpython-acee48628d6df976170c289227def0644cf2dbf5.tar.bz2
Repair failing test_sre.py.
This was a funny one! The test very subtly relied on 1.5.2's behavior of treating "\x%" as "\x%", i.e. ignoring that was an \x escape that didn't make sense. But /F implemented PEP 223, which causes 2.0 to raise an exception on the bad escape. Fixed by merely making the 3 such strings of this kind into raw strings.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sre.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py
index 1eea12f..5c56a28 100644
--- a/Lib/test/test_sre.py
+++ b/Lib/test/test_sre.py
@@ -50,9 +50,9 @@ for i in [0, 8, 16, 32, 64, 127, 128, 255]:
test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1)
test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1)
- test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1)
- test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1)
- test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1)
+ test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1)
+ test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1)
+ test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1)
test(r"""sre.match("\911", "")""", None, sre.error)
#