Skip to content

Commit

Permalink
Fix Twisted 15.0.0 URI class renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
NateShoffner committed Apr 12, 2015
1 parent 3192dc5 commit 8868081
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyspades/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8868081

Please sign in to comment.