[Python-checkins] bpo-40656: Clean up detect_socket() (GH-20148)

ned-deily webhook-mailer at python.org
Tue Nov 17 19:09:19 EST 2020


https://github.com/python/cpython/commit/ccdcb20cbeb1943f506a422c3fd942651389a187
commit: ccdcb20cbeb1943f506a422c3fd942651389a187
branch: master
author: Erlend Egeberg Aasland <erlend.aasland at innova.no>
committer: ned-deily <nad at python.org>
date: 2020-11-17T19:08:58-05:00
summary:

bpo-40656: Clean up detect_socket() (GH-20148)

files:
M setup.py

diff --git a/setup.py b/setup.py
index 91358af9b616b..6546544a99d0d 100644
--- a/setup.py
+++ b/setup.py
@@ -1154,18 +1154,16 @@ def detect_crypt(self):
 
     def detect_socket(self):
         # socket(2)
-        if not VXWORKS:
-            kwargs = {'depends': ['socketmodule.h']}
-            if MACOS:
-                # Issue #35569: Expose RFC 3542 socket options.
-                kwargs['extra_compile_args'] = ['-D__APPLE_USE_RFC_3542']
-
-            self.add(Extension('_socket', ['socketmodule.c'], **kwargs))
-        elif self.compiler.find_library_file(self.lib_dirs, 'net'):
-            libs = ['net']
-            self.add(Extension('_socket', ['socketmodule.c'],
-                               depends=['socketmodule.h'],
-                               libraries=libs))
+        kwargs = {'depends': ['socketmodule.h']}
+        if VXWORKS:
+            if not self.compiler.find_library_file(self.lib_dirs, 'net'):
+                return
+            kwargs['libraries'] = ['net']
+        elif MACOS:
+            # Issue #35569: Expose RFC 3542 socket options.
+            kwargs['extra_compile_args'] = ['-D__APPLE_USE_RFC_3542']
+
+        self.add(Extension('_socket', ['socketmodule.c'], **kwargs))
 
     def detect_dbm_gdbm(self):
         # Modules that provide persistent dictionary-like semantics.  You will



More information about the Python-checkins mailing list