From 0c0e1b3adb2368be5eb1182b5f1c64a2880254ba Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Wed, 16 Sep 2020 18:00:44 +0100 Subject: [PATCH] populate-depot: Silence mypy warnings Signed-off-by: Simon McVittie <smcv@collabora.com> --- populate-depot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/populate-depot.py b/populate-depot.py index 7f0edd8..5835be4 100755 --- a/populate-depot.py +++ b/populate-depot.py @@ -458,8 +458,8 @@ class Main: for path in ('metadata/VERSION.txt', 'sources/VERSION.txt'): full = os.path.join(self.depot, 'pressure-vessel', path) if os.path.exists(full): - with open(full) as reader: - version = reader.read().rstrip('\n') + with open(full) as text_reader: + pv_version.version = text_reader.read().rstrip('\n') break @@ -655,7 +655,9 @@ class Main: stdout=subprocess.PIPE, universal_newlines=True, ) as describe: - version = describe.stdout.read().strip() + stdout = describe.stdout + assert stdout is not None + version = stdout.read().strip() # Deliberately ignoring exit status: # if git is missing or old we'll use 'unknown' except (OSError, subprocess.SubprocessError): -- GitLab