mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-24 15:00:57 -05:00
Fix issues on Windows
This commit is contained in:
parent
a9ee3a4327
commit
2ab6536563
1 changed files with 11 additions and 4 deletions
|
@ -528,9 +528,16 @@ class Installer:
|
|||
if self._bin_dir.joinpath(script).exists():
|
||||
self._bin_dir.joinpath(script).unlink()
|
||||
|
||||
self._bin_dir.joinpath(script).symlink_to(
|
||||
self._data_dir.joinpath(target_script)
|
||||
)
|
||||
try:
|
||||
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:
|
||||
self._overwrite(
|
||||
|
@ -553,7 +560,7 @@ class Installer:
|
|||
else:
|
||||
specification = f"poetry=={version}"
|
||||
|
||||
subprocess.call(
|
||||
subprocess.run(
|
||||
[str(python), "-m", "pip", "install", specification],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
|
|
Loading…
Reference in a new issue