From ccc21fd00b90b3bc56536f0cae0c3a0b7840166f Mon Sep 17 00:00:00 2001 From: Bartek Sokorski Date: Thu, 19 May 2022 18:58:59 +0200 Subject: [PATCH] Raise error when 2.7 env --- src/poetry/utils/env.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/poetry/utils/env.py b/src/poetry/utils/env.py index 8c5867893fb..3499c16c37d 100644 --- a/src/poetry/utils/env.py +++ b/src/poetry/utils/env.py @@ -1637,9 +1637,12 @@ def get_pip_command(self, embedded: bool = False) -> list[str]: ] def get_supported_tags(self) -> list[Tag]: - output = self.run_python_script(GET_SYS_TAGS) + if self.get_version_info() < (3, 0, 0): + raise NotImplementedError("Poetry does not support python 2.7 environments") + else: + output = self.run_python_script(GET_SYS_TAGS) - return [Tag(*t) for t in json.loads(output)] + return [Tag(*t) for t in json.loads(output)] def get_marker_env(self) -> dict[str, Any]: output = self.run_python_script(GET_ENVIRONMENT_INFO)