From 48169a8f477e269a9f0db36f8f7e70d46874414d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 19 Dec 2022 18:35:58 +0300 Subject: [PATCH] =?UTF-8?q?TG-85=20cl-update:=20=D0=B2=20try\except=20?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D1=8B=D1=85=20=D1=82=D1=8D=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/emerge_parser.py | 5 ++++- pym/update/update.py | 2 +- pym/update/variables/update.py | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pym/update/emerge_parser.py b/pym/update/emerge_parser.py index 0d13a88..bf7b2b8 100644 --- a/pym/update/emerge_parser.py +++ b/pym/update/emerge_parser.py @@ -88,7 +88,10 @@ class CommandExecutor(): def close(self): if self.child is not None: - self.child.close() + try: + self.child.close() + except pexpect.ExceptionPexpect: + self.child.close(force=True) self.child = None def success(self): diff --git a/pym/update/update.py b/pym/update/update.py index 9090b52..eeed960 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -2107,7 +2107,7 @@ class Update(MethodsInterface): if branch_name == Git.Reference.Tag and tag.isdigit(): self._set_saved_tag(tag) return True - except ValueError as e: + except (ValueError, FileNotFoundError) as e: return False def _update_increment_current_level(self): diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index d8ae0d1..b50eeb1 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -179,8 +179,8 @@ class VariableClUpdateInnerRepList(Variable): def get(self): def gen(): - val = self.Get('cl_update_rep_list') - prev_host = self.Get('cl_update_rep_hosting') + val = self.Get('cl_update_rep_list') or '' + prev_host = self.Get('cl_update_rep_hosting') or '' if prev_host: for dct in val: for key, value in dct.items(): @@ -202,6 +202,7 @@ class VariableClUpdateRepHostingChoice(Variable): value = '' opt = ["--repo-update"] metavalue = "REPOSITORY URL" + check_after = ['cl_update_inner_rep_list'] def init(self): self.label = (_("Update repository"))