Use "x in y" instead of y.find(x) != -1.
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
index f692533..a7681a9 100644
--- a/Lib/test/test_file2k.py
+++ b/Lib/test/test_file2k.py
@@ -227,7 +227,7 @@
         except ValueError, 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.