[test/test_http] Fix getsockname() on Jython
authorYen Chi Hsuan <yan12125@gmail.com>
Sun, 29 May 2016 11:24:28 +0000 (19:24 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 2 Jun 2016 07:00:49 +0000 (15:00 +0800)
test/test_http.py

index 6b8493e5e6b9522ebe594872067f41d8eb365fc2..5076ced510847b83b2ac7a5374b92ef248ba8ec8 100644 (file)
@@ -17,7 +17,7 @@ TEST_DIR = os.path.dirname(os.path.abspath(__file__))
 
 
 def http_server_port(httpd):
-    if os.name == 'java':
+    if os.name == 'java' and isinstance(httpd.socket, ssl.SSLSocket):
         # In Jython SSLSocket is not a subclass of socket.socket
         sock = httpd.socket.sock
     else: