Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 538f05c

Browse files
author
Fredrik Lundh
committed
reapplied Fred's "recommended style" patch...
1 parent 770617b commit 538f05c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/test/test_sre.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ def test(expression, result, exception=None):
4747
print 'Running tests on character literals'
4848

4949
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
50-
test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1)
51-
test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1)
52-
test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1)
53-
test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1)
54-
test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1)
55-
test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1)
50+
test(r"""sre.match(r"\%03o" % i, chr(i)) is not None""", 1)
51+
test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") is not None""", 1)
52+
test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") is not None""", 1)
53+
test(r"""sre.match(r"\x%02x" % i, chr(i)) is not None""", 1)
54+
test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") is not None""", 1)
55+
test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") is not None""", 1)
5656
test(r"""sre.match("\911", "")""", None, sre.error)
5757

5858
#
@@ -197,11 +197,11 @@ def bump_num(matchobj):
197197
p = ""
198198
for i in range(0, 256):
199199
p = p + chr(i)
200-
test(r"""sre.match(sre.escape(chr(i)), chr(i)) != None""", 1)
200+
test(r"""sre.match(sre.escape(chr(i)), chr(i)) is not None""", 1)
201201
test(r"""sre.match(sre.escape(chr(i)), chr(i)).span()""", (0,1))
202202

203203
pat = sre.compile(sre.escape(p))
204-
test(r"""pat.match(p) != None""", 1)
204+
test(r"""pat.match(p) is not None""", 1)
205205
test(r"""pat.match(p).span()""", (0,256))
206206

207207
if verbose:

0 commit comments

Comments
 (0)