mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Use "x in y" instead of y.find(x) != -1.
This commit is contained in:
parent
d80b4bfd0b
commit
187f93d986
4 changed files with 4 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue