diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2020-11-18 00:08:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 00:08:58 (GMT) |
commit | ccdcb20cbeb1943f506a422c3fd942651389a187 (patch) | |
tree | 49dfd523fbb56905db23a5f824dc23382d50e202 /setup.py | |
parent | d0d4a450679bfc90eae7be4fdb5499e87f661b3e (diff) | |
download | cpython-ccdcb20cbeb1943f506a422c3fd942651389a187.zip cpython-ccdcb20cbeb1943f506a422c3fd942651389a187.tar.gz cpython-ccdcb20cbeb1943f506a422c3fd942651389a187.tar.bz2 |
bpo-40656: Clean up detect_socket() (GH-20148)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -1154,18 +1154,16 @@ class PyBuildExt(build_ext): 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 |