aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-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