Skip to content

Commit e05dc3d

Browse files
authored
Merge pull request #72 from wpyoga/fix-pytest-issue
Fix error in new _getNetworkAddrs code
2 parents 91b1514 + cfc2014 commit e05dc3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wsdiscovery/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ def _getNetworkAddrs(protocol_version):
257257
if protocol_version == socket.AF_INET:
258258
for iface in ifaces:
259259
for ip in iface.ips:
260-
if type(ip.ip) is string:
260+
if isinstance(ip.ip, str):
261261
ip_address = ipaddress.ip_address(ip.ip)
262262
if not ip_address.is_loopback:
263263
addrs.append(ip_address)
264264
elif protocol_version == socket.AF_INET6:
265265
for iface in ifaces:
266266
for ip in iface.ips:
267-
if type(ip.ip) is tuple:
267+
if isinstance(ip.ip, tuple):
268268
ip_address = ipaddress.ip_address(f"{ip.ip[0]}%{ip.ip[2]}")
269269
if not ip_address.is_loopback:
270270
addrs.append(ip_address)

0 commit comments

Comments
 (0)