Use "x in y" instead of y.find(x) != -1.

This commit is contained in:
Ezio Melotti 2010-03-17 14:22:34 +00:00
parent d80b4bfd0b
commit 187f93d986
4 changed files with 4 additions and 4 deletions

View file

@ -320,7 +320,7 @@ class OtherFileTests(unittest.TestCase):
except ValueError as msg:
if msg.args[0] != 0:
s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
if TESTFN in s or bad_mode not in s:
self.fail("bad error message for invalid mode: %s" % s)
# if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed.