Skip to content

Commit 12a1fc2

Browse files
authored
Properly hide PEP-632 warning on latest version of setuptools (#2251)
1 parent 1431bef commit 12a1fc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/virtualenv/discovery/py_info.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ def _distutils_install():
152152
d = dist.Distribution({"script_args": "--no-user-cfg"}) # conf files not parsed so they do not hijack paths
153153
if hasattr(sys, "_framework"):
154154
sys._framework = None # disable macOS static paths for framework
155-
i = d.get_command_obj("install", create=True)
155+
156+
with warnings.catch_warnings(): # disable warning for PEP-632
157+
warnings.simplefilter("ignore")
158+
i = d.get_command_obj("install", create=True)
159+
156160
i.prefix = os.sep # paths generated are relative to prefix that contains the path sep, this makes it relative
157161
i.finalize_options()
158162
result = {key: (getattr(i, "install_{}".format(key))[1:]).lstrip(os.sep) for key in SCHEME_KEYS}

0 commit comments

Comments
 (0)