summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileio.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-03-17 14:22:34 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-03-17 14:22:34 (GMT)
commit187f93d986a571b0a7d797a3b114d5d877d261e1 (patch)
tree01b3cccd30d2d1458346d32ef9b8ec17ad55b21d /Lib/test/test_fileio.py
parentd80b4bfd0b291d543c682d7dac0841de0192a238 (diff)
downloadcpython-187f93d986a571b0a7d797a3b114d5d877d261e1.zip
cpython-187f93d986a571b0a7d797a3b114d5d877d261e1.tar.gz
cpython-187f93d986a571b0a7d797a3b114d5d877d261e1.tar.bz2
Use "x in y" instead of y.find(x) != -1.
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r--Lib/test/test_fileio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 5057941..21d231f 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -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.