1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Convert to str shutil.move src arg for py<=39

https://github.com/python/cpython/issues/76870
This commit is contained in:
q0w 2022-06-15 21:57:48 +03:00
parent bd1563d421
commit 3181063f94
2 changed files with 6 additions and 2 deletions

View file

@ -664,7 +664,7 @@ def test_wheel_install_fails_with_unrelated_dist_info(
package = create_basic_wheel_for_package(script, "simple", "0.1.0")
new_name = "unrelated-2.0.0-py2.py3-none-any.whl"
new_package = os.path.join(os.path.dirname(package), new_name)
shutil.move(package, new_package)
shutil.move(str(package), new_package)
result = script.pip(
"install",

View file

@ -171,7 +171,11 @@ class VirtualEnvironment:
self._create(clear=True)
def move(self, location: Union[Path, str]) -> None:
shutil.move(self.location, location)
if sys.version_info <= (3, 8):
src = str(self.location)
else:
src = self.location
shutil.move(src, location)
self.location = Path(location)
self._update_paths()