diff options
author | Ofek Lev <ofekmeister@gmail.com> | 2021-12-27 06:00:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-27 11:00:51 +0000 |
commit | 12a1fc2860761a9cd47c88a24093455d121570a3 (patch) | |
tree | cb45d4c6e0960b5edb904d1d74399c67654a7f0f | |
parent | 1431befa9373225d375d03dcd3aa2b83d51f7a62 (diff) | |
download | virtualenv-12a1fc2860761a9cd47c88a24093455d121570a3.tar.gz |
Properly hide PEP-632 warning on latest version of `setuptools` (#2251)
-rw-r--r-- | src/virtualenv/discovery/py_info.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py index 8681735..4ba65b1 100644 --- a/src/virtualenv/discovery/py_info.py +++ b/src/virtualenv/discovery/py_info.py @@ -152,7 +152,11 @@ class PythonInfo(object): d = dist.Distribution({"script_args": "--no-user-cfg"}) # conf files not parsed so they do not hijack paths if hasattr(sys, "_framework"): sys._framework = None # disable macOS static paths for framework - i = d.get_command_obj("install", create=True) + + with warnings.catch_warnings(): # disable warning for PEP-632 + warnings.simplefilter("ignore") + i = d.get_command_obj("install", create=True) + i.prefix = os.sep # paths generated are relative to prefix that contains the path sep, this makes it relative i.finalize_options() result = {key: (getattr(i, "install_{}".format(key))[1:]).lstrip(os.sep) for key in SCHEME_KEYS} |