diff options
author | Mike Gilbert <floppym@gentoo.org> | 2018-01-05 13:30:32 -0500 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2019-12-29 10:29:26 +0100 |
commit | 1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9 (patch) | |
tree | 2202fc1a615ac60ba75121f23d3056964d6d06ca | |
parent | Install libpythonX.Y.a in /usr/lib instead of /usr/lib/pythonX.Y/config (diff) | |
download | cpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.tar.gz cpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.tar.bz2 cpython-1a5ce806ec7c5eb81cdc3e71fa411b2a7d320ab9.zip |
Disable modules and SSL
-rw-r--r-- | setup.py | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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') |