@@ -47,12 +47,12 @@ def test(expression, result, exception=None):
4747 print 'Running tests on character literals'
4848
4949for 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 )
5656test (r"""sre.match("\911", "")""" , None , sre .error )
5757
5858#
@@ -197,11 +197,11 @@ def bump_num(matchobj):
197197p = ""
198198for 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
203203pat = sre .compile (sre .escape (p ))
204- test (r"""pat.match(p) != None""" , 1 )
204+ test (r"""pat.match(p) is not None""" , 1 )
205205test (r"""pat.match(p).span()""" , (0 ,256 ))
206206
207207if verbose :
0 commit comments