diff options
| author | Ian Wienand <ian@wienand.org> | 2020-05-04 16:52:59 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-04 07:52:59 +0100 |
| commit | 73793c76c5ea8253b86ba905bb4a1ac005d4abb7 (patch) | |
| tree | 0b1d8405e461a5aeaf24189d993c6f6ad8fc9b3e /src | |
| parent | 6dffcf2ae7b5b55098cf3c8326472f988277cb70 (diff) | |
| download | virtualenv-73793c76c5ea8253b86ba905bb4a1ac005d4abb7.tar.gz | |
Wrap usage of get_makefile_filename (#1811)
Diffstat (limited to 'src')
| -rw-r--r-- | src/virtualenv/create/debug.py | 4 | ||||
| -rw-r--r-- | src/virtualenv/discovery/py_info.py | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/virtualenv/create/debug.py b/src/virtualenv/create/debug.py index 23c380c..0cdaa49 100644 --- a/src/virtualenv/create/debug.py +++ b/src/virtualenv/create/debug.py @@ -55,7 +55,9 @@ def run(): try: import sysconfig - result["makefile_filename"] = encode_path(sysconfig.get_makefile_filename()) + # https://bugs.python.org/issue22199 + makefile = getattr(sysconfig, "get_makefile_filename", getattr(sysconfig, "_get_makefile_filename", None)) + result["makefile_filename"] = encode_path(makefile()) except ImportError: pass diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py index 4ceeebb..cdf7b47 100644 --- a/src/virtualenv/discovery/py_info.py +++ b/src/virtualenv/discovery/py_info.py @@ -75,11 +75,13 @@ class PythonInfo(object): self.stdout_encoding = u(getattr(sys.stdout, "encoding", None)) self.sysconfig_paths = {u(i): u(sysconfig.get_path(i, expand=False)) for i in sysconfig.get_path_names()} - + # https://bugs.python.org/issue22199 + makefile = getattr(sysconfig, "get_makefile_filename", getattr(sysconfig, "_get_makefile_filename", None)) self.sysconfig = { u(k): u(v) - for k, v in [ # a list of content to store from sysconfig - ("makefile_filename", sysconfig.get_makefile_filename()), + for k, v in [ + # a list of content to store from sysconfig + ("makefile_filename", makefile()), ] if k is not None } |
