diff --git a/RNS/Interfaces/TCPInterface.py b/RNS/Interfaces/TCPInterface.py index c7d0deb..3684165 100644 --- a/RNS/Interfaces/TCPInterface.py +++ b/RNS/Interfaces/TCPInterface.py @@ -286,7 +286,7 @@ class TCPServerInterface(Interface): @staticmethod def get_address_for_if(name): import importlib - if importlib.find_loader('netifaces') != None: + if importlib.util.find_spec('netifaces') != None: import netifaces return netifaces.ifaddresses(name)[netifaces.AF_INET][0]['addr'] else: @@ -297,7 +297,7 @@ class TCPServerInterface(Interface): @staticmethod def get_broadcast_for_if(name): import importlib - if importlib.find_loader('netifaces') != None: + if importlib.util.find_spec('netifaces') != None: import netifaces return netifaces.ifaddresses(name)[netifaces.AF_INET][0]['broadcast'] else: diff --git a/RNS/Interfaces/UDPInterface.py b/RNS/Interfaces/UDPInterface.py index 2f1670f..98d52c0 100644 --- a/RNS/Interfaces/UDPInterface.py +++ b/RNS/Interfaces/UDPInterface.py @@ -12,7 +12,7 @@ class UDPInterface(Interface): @staticmethod def get_address_for_if(name): import importlib - if importlib.find_loader('netifaces') != None: + if importlib.util.find_spec('netifaces') != None: import netifaces return netifaces.ifaddresses(name)[netifaces.AF_INET][0]['addr'] else: @@ -23,7 +23,7 @@ class UDPInterface(Interface): @staticmethod def get_broadcast_for_if(name): import importlib - if importlib.find_loader('netifaces') != None: + if importlib.util.find_spec('netifaces') != None: import netifaces return netifaces.ifaddresses(name)[netifaces.AF_INET][0]['broadcast'] else: