From 1a532e3ee12c92e4a83d6104a23bcad0656a2f27 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Thu, 3 Oct 2024 22:06:20 +0200 Subject: [PATCH] chore(src): Address xml deprecation working (#210) DeprecationWarning: Testing an element's truth value will raise an exception in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. if (host_sec): --- src/wsdd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wsdd.py b/src/wsdd.py index 085e868..ec815a0 100755 --- a/src/wsdd.py +++ b/src/wsdd.py @@ -646,7 +646,7 @@ def update(self, xml_str: str, xaddr: str, interface: NetworkInterface) -> None: elif dialect == WSDP_URI + '/Relationship': host_xpath = 'wsdp:Relationship[@Type="{}/host"]/wsdp:Host'.format(WSDP_URI) host_sec = section.find(host_xpath, namespaces) - if (host_sec): + if (host_sec is not None): self.extract_host_props(host_sec) else: logger.debug('unknown metadata dialect ({})'.format(dialect))