Contents of /trunk/python/patches/python-3.3.2-disable_modules_and_ssl.patch
Parent Directory | Revision Log
Revision 2266 -
(show annotations)
(download)
Wed Aug 21 15:15:17 2013 UTC (11 years, 1 month ago) by niro
File size: 2080 byte(s)
Wed Aug 21 15:15:17 2013 UTC (11 years, 1 month ago) by niro
File size: 2080 byte(s)
-re-diffed patches for 3.3.2
1 | --- setup.py |
2 | +++ setup.py |
3 | @@ -31,7 +31,17 @@ |
4 | COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) |
5 | |
6 | # This global variable is used to hold the list of modules to be disabled. |
7 | -disabled_module_list = [] |
8 | +pdm_env = "PYTHON_DISABLE_MODULES" |
9 | +if pdm_env in os.environ: |
10 | + disabled_module_list = os.environ[pdm_env].split() |
11 | +else: |
12 | + disabled_module_list = [] |
13 | + |
14 | +pds_env = "PYTHON_DISABLE_SSL" |
15 | +if pds_env in os.environ: |
16 | + disable_ssl = os.environ[pds_env] |
17 | +else: |
18 | + disable_ssl = 0 |
19 | |
20 | def add_dir_to_list(dirlist, dir): |
21 | """Add the directory 'dir' to the list 'dirlist' (after any relative |
22 | @@ -435,6 +445,7 @@ |
23 | os.unlink(tmpfile) |
24 | |
25 | def detect_modules(self): |
26 | + global disable_ssl |
27 | # Ensure that /usr/local is always used, but the local build |
28 | # directories (i.e. '.' and 'Include') must be first. See issue |
29 | # 10520. |
30 | @@ -747,7 +758,7 @@ |
31 | ssl_incs = find_file('openssl/ssl.h', inc_dirs, |
32 | search_for_ssl_incs_in |
33 | ) |
34 | - if ssl_incs is not None: |
35 | + if ssl_incs is not None and not disable_ssl: |
36 | krb5_h = find_file('krb5.h', inc_dirs, |
37 | ['/usr/kerberos/include']) |
38 | if krb5_h: |
39 | @@ -758,7 +769,8 @@ |
40 | ] ) |
41 | |
42 | if (ssl_incs is not None and |
43 | - ssl_libs is not None): |
44 | + ssl_libs is not None and |
45 | + not disable_ssl): |
46 | exts.append( Extension('_ssl', ['_ssl.c'], |
47 | include_dirs = ssl_incs, |
48 | library_dirs = ssl_libs, |
49 | @@ -791,7 +803,7 @@ |
50 | |
51 | #print('openssl_ver = 0x%08x' % openssl_ver) |
52 | min_openssl_ver = 0x00907000 |
53 | - have_any_openssl = ssl_incs is not None and ssl_libs is not None |
54 | + have_any_openssl = ssl_incs is not None and ssl_libs is not None and not disable_ssl |
55 | have_usable_openssl = (have_any_openssl and |
56 | openssl_ver >= min_openssl_ver) |
57 |