diff --git a/pocsuite3/lib/core/common.py b/pocsuite3/lib/core/common.py index ad2fd6e1..f5deb2f7 100644 --- a/pocsuite3/lib/core/common.py +++ b/pocsuite3/lib/core/common.py @@ -43,6 +43,12 @@ from pocsuite3.lib.core.settings import URL_ADDRESS_REGEX +try: + collectionsAbc = collections.abc +except AttributeError: + collectionsAbc = collections + + def read_binary(filename): content = '' with open(filename, 'rb') as f: @@ -997,7 +1003,7 @@ def get_host_ipv6(dst='2001:db8::'): return s.getsockname()[0] -class OrderedSet(collections.OrderedDict, collections.MutableSet): +class OrderedSet(collections.OrderedDict, collectionsAbc.MutableSet): def add(self, e): self[e] = None