]> granicus.if.org Git - python/commitdiff
Fix SF bug #763770, test_socket_ssl crash
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 1 Jul 2003 13:44:28 +0000 (13:44 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 1 Jul 2003 13:44:28 +0000 (13:44 +0000)
Don't run any tests if there is no ssl support.

Lib/test/test_socket_ssl.py

index ccb8318c47864ca5e07e56b9ce9bd28d70ee4a95..544cdd90f1f4343dd844d450d410eb9d6d339480 100644 (file)
@@ -11,8 +11,6 @@ skip_expected = not (test_support.is_resource_enabled('network') and
 
 def test_basic():
     test_support.requires('network')
-    if not hasattr(socket, "ssl"):
-        raise test_support.TestSkipped("socket module has no ssl support")
 
     import urllib
 
@@ -61,6 +59,8 @@ def test_rude_shutdown():
     connector()
 
 def test_main():
+    if not hasattr(socket, "ssl"):
+        raise test_support.TestSkipped("socket module has no ssl support")
     test_rude_shutdown()
     test_basic()