aboutsummaryrefslogtreecommitdiffstats
path: root/pathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-20 11:27:05 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-20 11:27:05 +1300
commit01a449b5cb1106a867a6b73cd4877e9b2ec68171 (patch)
tree5a213fb4b8199d525079a55b64d6d232380be341 /pathod
parent301d52d9d05f2c5f074fe68c73acc1c32e518020 (diff)
downloadmitmproxy-01a449b5cb1106a867a6b73cd4877e9b2ec68171.tar.gz
mitmproxy-01a449b5cb1106a867a6b73cd4877e9b2ec68171.tar.bz2
mitmproxy-01a449b5cb1106a867a6b73cd4877e9b2ec68171.zip
netlib.exceptions.* -> mitmproxy.exceptions
Diffstat (limited to 'pathod')
-rw-r--r--pathod/language/writer.py4
-rw-r--r--pathod/pathoc.py2
-rw-r--r--pathod/pathod.py2
-rw-r--r--pathod/protocols/http.py4
-rw-r--r--pathod/protocols/websockets.py6
5 files changed, 9 insertions, 9 deletions
diff --git a/pathod/language/writer.py b/pathod/language/writer.py
index b8081989..ac0f44da 100644
--- a/pathod/language/writer.py
+++ b/pathod/language/writer.py
@@ -1,5 +1,5 @@
import time
-from netlib.exceptions import TcpDisconnect
+from mitmproxy import exceptions
BLOCKSIZE = 1024
# It's not clear what the upper limit for time.sleep is. It's lower than the
@@ -62,5 +62,5 @@ def write_values(fp, vals, actions, sofar=0, blocksize=BLOCKSIZE):
return True
elif a[1] == "inject":
send_chunk(fp, a[2], blocksize, 0, len(a[2]))
- except TcpDisconnect: # pragma: no cover
+ except exceptions.TcpDisconnect: # pragma: no cover
return True
diff --git a/pathod/pathoc.py b/pathod/pathoc.py
index 39dedf05..b67f6ee2 100644
--- a/pathod/pathoc.py
+++ b/pathod/pathoc.py
@@ -17,7 +17,7 @@ from netlib import tcp
from mitmproxy import certs
from netlib import websockets
from netlib import socks
-from netlib import exceptions
+from mitmproxy import exceptions
from netlib.http import http1
from mitmproxy.types import basethread
diff --git a/pathod/pathod.py b/pathod/pathod.py
index 5d951350..746998c5 100644
--- a/pathod/pathod.py
+++ b/pathod/pathod.py
@@ -10,7 +10,7 @@ from netlib import websockets
from mitmproxy import version
import urllib
-from netlib import exceptions
+from mitmproxy import exceptions
from pathod import language
from pathod import utils
diff --git a/pathod/protocols/http.py b/pathod/protocols/http.py
index 0822e864..a20a58a1 100644
--- a/pathod/protocols/http.py
+++ b/pathod/protocols/http.py
@@ -1,5 +1,5 @@
from mitmproxy import version
-from netlib.exceptions import TlsException
+from mitmproxy import exceptions
from netlib.http import http1
from .. import language
@@ -37,7 +37,7 @@ class HTTPProtocol:
options=self.pathod_handler.server.ssloptions.ssl_options,
alpn_select=self.pathod_handler.server.ssloptions.alpn_select,
)
- except TlsException as v:
+ except exceptions.TlsException as v:
s = str(v)
lg(s)
return None, dict(type="error", msg=s)
diff --git a/pathod/protocols/websockets.py b/pathod/protocols/websockets.py
index df83461a..585a48e3 100644
--- a/pathod/protocols/websockets.py
+++ b/pathod/protocols/websockets.py
@@ -1,8 +1,8 @@
import time
from netlib import websockets
-from .. import language
-from netlib.exceptions import NetlibException
+from pathod import language
+from mitmproxy import exceptions
class WebsocketsProtocol:
@@ -16,7 +16,7 @@ class WebsocketsProtocol:
started = time.time()
try:
frm = websockets.Frame.from_file(self.pathod_handler.rfile)
- except NetlibException as e:
+ except exceptions.NetlibException as e:
lg("Error reading websocket frame: %s" % e)
return None, None
ended = time.time()