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

installer: fix upgrade support check on scm version (#4126)

This commit is contained in:
Arun Babu Neelicattu 2021-06-04 11:08:42 +02:00 committed by GitHub
parent ef8511c1de
commit 4acfd05b53

View file

@ -415,10 +415,15 @@ class Installer:
def _is_self_upgrade_supported(x):
mx = self.VERSION_REGEX.match(x)
if mx is None:
# the version is not semver, perhaps scm or file, we assume upgrade is supported
return True
vx = tuple(int(p) for p in mx.groups()[:3]) + (mx.group(5),)
return vx >= (1, 2, 0)
if not _is_self_upgrade_supported(version):
if version and not _is_self_upgrade_supported(version):
self._write(
colorize(
"warning",