From 4aab47af38854afb5bc685e81808e6c147f2b17b Mon Sep 17 00:00:00 2001 From: deeplow Date: Thu, 21 Jul 2022 11:45:53 +0100 Subject: [PATCH] ignore type hint to windows-only subprocess command `subprocess.STARTUPINFO()` only exists in windows systems. Because of this, in linux-based systems it was raising type hint issues as it didn't recognize the return function. --- dangerzone/container.py | 4 ++-- dangerzone/global_common.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dangerzone/container.py b/dangerzone/container.py index cd7eb8d..14c034d 100644 --- a/dangerzone/container.py +++ b/dangerzone/container.py @@ -17,8 +17,8 @@ else: # Define startupinfo for subprocesses if platform.system() == "Windows": - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + startupinfo = subprocess.STARTUPINFO() # type: ignore [attr-defined] + startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore [attr-defined] else: startupinfo = None diff --git a/dangerzone/global_common.py b/dangerzone/global_common.py index a979ff9..362de41 100644 --- a/dangerzone/global_common.py +++ b/dangerzone/global_common.py @@ -417,7 +417,7 @@ class GlobalCommon(object): resource_path = prefix.joinpath(filename) return str(resource_path) - def get_subprocess_startupinfo(self): + def get_subprocess_startupinfo(self): # type: ignore [no-untyped-def] if platform.system() == "Windows": startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW