aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-01-05 13:30:32 -0500
committerMichał Górny <mgorny@gentoo.org>2021-09-29 19:13:28 +0200
commitcc91802c4c8639c4b0962728319dd5f76ade21b1 (patch)
treec8e91e66c3beb2ede621bfda0ef11a3c4b620b49
parent[typo] s/libexpact/libexpat/ in setup.py (GH-28624) (diff)
downloadcpython-cc91802c4c8639c4b0962728319dd5f76ade21b1.tar.gz
cpython-cc91802c4c8639c4b0962728319dd5f76ade21b1.tar.bz2
cpython-cc91802c4c8639c4b0962728319dd5f76ade21b1.zip
Disable modules and SSL
-rw-r--r--setup.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 6122430cd04..4e598f6a2f4 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,17 @@ with warnings.catch_warnings():
TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes')
# This global variable is used to hold the list of modules to be disabled.
-DISABLED_MODULE_LIST = []
+pdm_env = "PYTHON_DISABLE_MODULES"
+if pdm_env in os.environ:
+ DISABLED_MODULE_LIST = os.environ[pdm_env].split()
+else:
+ DISABLED_MODULE_LIST = []
+
+pds_env = "PYTHON_DISABLE_SSL"
+if pds_env in os.environ:
+ disable_ssl = os.environ[pds_env]
+else:
+ disable_ssl = 0
# --list-module-names option used by Tools/scripts/generate_module_names.py
LIST_MODULE_NAMES = False
@@ -2424,6 +2434,7 @@ class PyBuildExt(build_ext):
depends=depends))
def detect_openssl_hashlib(self):
+ global disable_ssl
# Detect SSL support for the socket module (via _ssl)
config_vars = sysconfig.get_config_vars()
@@ -2442,7 +2453,7 @@ class PyBuildExt(build_ext):
openssl_libdirs = split_var('OPENSSL_LDFLAGS', '-L')
openssl_libs = split_var('OPENSSL_LIBS', '-l')
openssl_rpath = config_vars.get('OPENSSL_RPATH')
- if not openssl_libs:
+ if not openssl_libs or disable_ssl:
# libssl and libcrypto not found
self.missing.extend(['_ssl', '_hashlib'])
return None, None