aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-01-05 13:30:32 -0500
committerMichał Górny <mgorny@gentoo.org>2019-12-29 10:29:26 +0100
commit1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9 (patch)
tree2202fc1a615ac60ba75121f23d3056964d6d06ca
parentInstall libpythonX.Y.a in /usr/lib instead of /usr/lib/pythonX.Y/config (diff)
downloadcpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.tar.gz
cpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.tar.bz2
cpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.zip
Disable modules and SSL
-rw-r--r--setup.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 88cff6164d7..6d45ccd3ee5 100644
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,17 @@ host_platform = get_platform()
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# 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
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (after any relative
@@ -581,6 +591,7 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
def detect_modules(self):
+ global disable_ssl
# Ensure that /usr/local is always used, but the local build
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
@@ -920,11 +931,11 @@ class PyBuildExt(build_ext):
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
ssl_ext, hashlib_ext = self._detect_openssl(inc_dirs, lib_dirs)
- if ssl_ext is not None:
+ if ssl_ext is not None and not disable_ssl:
exts.append(ssl_ext)
else:
missing.append('_ssl')
- if hashlib_ext is not None:
+ if hashlib_ext is not None and not disable_ssl:
exts.append(hashlib_ext)
else:
missing.append('_hashlib')