Skip to content

Commit

Permalink
make it work with twisted 15.x
Browse files Browse the repository at this point in the history
  • Loading branch information
leif committed Jul 2, 2015
1 parent ff027ac commit 38f1a0c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions txtorhttpproxy/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
import os
import binascii
from zope.interface import implementer

from twisted.web.client import Agent, _URI
from twisted.internet.endpoints import clientFromString
from twisted.web.iweb import IAgent
from twisted.web.error import SchemeNotSupported
from twisted.internet.endpoints import clientFromString

from twisted.web.client import Agent
try:
from twisted.web.client import URI
except ImportError:
# for twisted 14.x
from twisted.web.client import _URI as URI

class TorAgentCircuitIsolationModeNotSupported(Exception):
"""
Expand Down Expand Up @@ -146,7 +149,7 @@ def request(self, method, uri, headers=None, bodyProducer=None):
@see: L{twisted.web.iweb.IAgent.request}
"""
parsedURI = _URI.fromBytes(uri)
parsedURI = URI.fromBytes(uri)
endpoint = self._getEndpoint(parsedURI.scheme, parsedURI.host,
parsedURI.port)

Expand Down

0 comments on commit 38f1a0c

Please sign in to comment.