From 808e7b542f24fce30f1efab306bf97d86b8e1007 Mon Sep 17 00:00:00 2001 From: Sohum <31165513+ssmendon@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:14:18 -0700 Subject: [PATCH] ddclient: Domeneshop - use '==' instead of 'is' (#3841) Since Python 3.8, 'is' and 'is not' produce warnings when its behavior is undefined by the language spec. See: https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior --- .../src/opnsense/scripts/ddclient/lib/account/domeneshop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py index 621ec1ce7..91bbe27f5 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py @@ -67,7 +67,7 @@ class Domeneshop(BaseAccount): response = requests.get(**req_opts) # Parse response and update state and log - if response.status_code is 204: + if response.status_code == 204: if self.is_verbose: syslog.syslog( syslog.LOG_NOTICE, @@ -75,7 +75,7 @@ class Domeneshop(BaseAccount): ) self.update_state(address=self.current_address, status=response.text.split()[0] if response.text else '') return True - elif response.status_code is 404: + elif response.status_code == 404: syslog.syslog( syslog.LOG_ERR, "Account %s failed to set new ip %s [%d - %s], because %s could not be found" % (