mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-21 21:50:58 -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:
|
elif self._path:
|
||||||
version = self._path
|
version = self._path
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
version, current_version = self.get_version()
|
version, current_version = self.get_version()
|
||||||
|
except ValueError:
|
||||||
|
return 1
|
||||||
|
|
||||||
if version is None:
|
if version is None:
|
||||||
return 0
|
return 0
|
||||||
|
@ -756,11 +759,10 @@ class Installer:
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._version and self._version not in releases:
|
if self._version and self._version not in releases:
|
||||||
self._write(
|
msg = "Version {} does not exist.".format(self._version)
|
||||||
colorize("error", "Version {} does not exist.".format(self._version))
|
self._write(colorize("error", msg))
|
||||||
)
|
|
||||||
|
|
||||||
return None, None
|
raise ValueError(msg)
|
||||||
|
|
||||||
version = self._version
|
version = self._version
|
||||||
if not version:
|
if not version:
|
||||||
|
|
Loading…
Reference in a new issue