diff --git a/pyspades/web.py b/pyspades/web.py index e374e044..7edc2046 100644 --- a/pyspades/web.py +++ b/pyspades/web.py @@ -9,8 +9,13 @@ def getPage(url, bindAddress = None, *arg, **kw): if hasattr(client, '_parse'): scheme, host, port, path = client._parse(url) else: - from twisted.web.client import _URI - uri = _URI.fromBytes(url) + # _URI class renamed to URI in 15.0.0 + try: + from twisted.web.client import _URI as URI + except ImportError: + from twisted.web.client import URI + + uri = URI.fromBytes(url) scheme = uri.scheme host = uri.host port = uri.port