1
0
Fork 0
mirror of https://github.com/python-poetry/install.python-poetry.org.git synced 2024-11-06 06:05:52 -05:00

Fix issues on Windows

This commit is contained in:
Sébastien Eustace 2021-03-19 11:32:23 +01:00 committed by Arun Babu Neelicattu
parent a9ee3a4327
commit 2ab6536563

View file

@ -528,9 +528,16 @@ class Installer:
if self._bin_dir.joinpath(script).exists(): if self._bin_dir.joinpath(script).exists():
self._bin_dir.joinpath(script).unlink() self._bin_dir.joinpath(script).unlink()
self._bin_dir.joinpath(script).symlink_to( try:
self._data_dir.joinpath(target_script) self._bin_dir.joinpath(script).symlink_to(
) self._data_dir.joinpath(target_script)
)
except OSError:
# This can happen if the user
# does not have the correct permission on Windows
shutil.copy(
self._data_dir.joinpath(target_script), self._bin_dir.joinpath(script)
)
def install_poetry(self, version: str, env_path: Path) -> None: def install_poetry(self, version: str, env_path: Path) -> None:
self._overwrite( self._overwrite(
@ -553,7 +560,7 @@ class Installer:
else: else:
specification = f"poetry=={version}" specification = f"poetry=={version}"
subprocess.call( subprocess.run(
[str(python), "-m", "pip", "install", specification], [str(python), "-m", "pip", "install", specification],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,