Fix comparisons for pyflakes 2.1
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 3 Feb 2019 00:28:23 +0000 (00:28 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sun, 3 Feb 2019 00:28:23 +0000 (00:28 +0000)
The latest release of flake8 updates to pyflakes 2.1, and with that
comes an expectation that typical variable equality comparisons
should avoid the use of "is" and "is not" for safety. Adjust a
couple places we previously ran afoul of the new F632 check.

mudpy/misc.py
mudpy/tests/selftest.py

index 2bf4db3..7c013a8 100644 (file)
@@ -636,7 +636,7 @@ class User:
 
     def authenticate(self):
         """Flag the user as authenticated and disconnect duplicates."""
-        if self.state is not "authenticated":
+        if self.state != "authenticated":
             self.authenticated = True
             if ("mudpy.limit" in universe.contents and self.account.subkey in
                     universe.contents["mudpy.limit"].get("admins")):
index 055e50a..2cbed03 100644 (file)
@@ -475,7 +475,7 @@ def main():
                     conversant].read_very_eager().decode("utf-8")
             except Exception:
                 pass
-            if index is not 0:
+            if index != 0:
                 tlog("\nERROR: luser%s did not receive expected string:\n\n"
                      "%s\n\n"
                      "Check the end of capture_%s.log for received data."