[test/test_http] Fix getsockname() on Jython
[youtube-dl] / 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: