]> granicus.if.org Git - python/commitdiff
Issue #14310: Catch testing errors when trying to create unsupported socket
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 7 Apr 2012 20:38:44 +0000 (20:38 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 7 Apr 2012 20:38:44 +0000 (20:38 +0000)
types on some platforms.

Lib/test/test_socket.py

index 6da423ac6998cdcae9bcf323963202a4be0cce73..092e94f38034b83bc764fd7fd2b9977b749bf7a1 100644 (file)
@@ -4735,7 +4735,10 @@ class TestSocketSharing(SocketTCPTest):
         types = [socket.SOCK_STREAM, socket.SOCK_DGRAM]
         for f in families:
             for t in types:
-                source = socket.socket(f, t)
+                try:
+                    source = socket.socket(f, t)
+                except OSError:
+                    continue # This combination is not supported
                 try:
                     data = source.share(os.getpid())
                     shared = socket.fromshare(data)