1
0
Fork 0
mirror of https://github.com/python-poetry/install.python-poetry.org.git synced 2024-11-21 13:41:04 -05:00

ensure exit code 1 on invalid version

This commit is contained in:
Stijn de Gooijer 2022-02-08 21:13:20 +01:00 committed by GitHub
parent 767db614c9
commit 7dcb4ce0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,7 +477,10 @@ class Installer:
elif self._path:
version = self._path
else:
version, current_version = self.get_version()
try:
version, current_version = self.get_version()
except ValueError:
return 1
if version is None:
return 0
@ -756,11 +759,10 @@ class Installer:
)
if self._version and self._version not in releases:
self._write(
colorize("error", "Version {} does not exist.".format(self._version))
)
msg = "Version {} does not exist.".format(self._version)
self._write(colorize("error", msg))
return None, None
raise ValueError(msg)
version = self._version
if not version: