From 7c8d68c0a1eb87d2078a2979c9f53662901450ff Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sun, 30 Jul 2023 15:34:56 -0400 Subject: [PATCH] components: fix pycodestyle E721 warnings Signed-off-by: Eric Callahan --- moonraker/components/mqtt.py | 2 +- moonraker/components/power.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moonraker/components/mqtt.py b/moonraker/components/mqtt.py index b5d36e2..a18a26b 100644 --- a/moonraker/components/mqtt.py +++ b/moonraker/components/mqtt.py @@ -482,7 +482,7 @@ class MQTTClient(APITransport, Subscribable): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception("MQTT Connection Error") last_err = e continue diff --git a/moonraker/components/power.py b/moonraker/components/power.py index 60f5f9f..60e5464 100644 --- a/moonraker/components/power.py +++ b/moonraker/components/power.py @@ -447,7 +447,7 @@ class HTTPDevice(PowerDevice): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception(f"Device Init Error: {self.name}") last_err = e await asyncio.sleep(5.) @@ -887,7 +887,7 @@ class TPLinkSmartPlug(PowerDevice): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception(f"Device Init Error: {self.name}") last_err = e await asyncio.sleep(5.)