aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/test.py')
-rw-r--r--netlib/test.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/netlib/test.py b/netlib/test.py
index bb0012ad..fb468907 100644
--- a/netlib/test.py
+++ b/netlib/test.py
@@ -1,6 +1,7 @@
+from __future__ import (absolute_import, print_function, division)
import threading, Queue, cStringIO
-import tcp, certutils
import OpenSSL
+from . import tcp, certutils
class ServerThread(threading.Thread):
def __init__(self, server):
@@ -63,7 +64,7 @@ class TServer(tcp.TCPServer):
key = OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_PEM, raw)
if self.ssl["v3_only"]:
method = tcp.SSLv3_METHOD
- options = tcp.OP_NO_SSLv2|tcp.OP_NO_TLSv1
+ options = OpenSSL.SSL.OP_NO_SSLv2 | OpenSSL.SSL.OP_NO_TLSv1
else:
method = tcp.SSLv23_METHOD
options = None
@@ -79,7 +80,7 @@ class TServer(tcp.TCPServer):
h.handle()
h.finish()
- def handle_error(self, request, client_address):
+ def handle_error(self, connection, client_address, fp=None):
s = cStringIO.StringIO()
- tcp.TCPServer.handle_error(self, request, client_address, s)
+ tcp.TCPServer.handle_error(self, connection, client_address, s)
self.q.put(s.getvalue())