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:
parent
767db614c9
commit
7dcb4ce0e4
1 changed files with 7 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue