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.
This commit is contained in:
deeplow 2022-07-21 11:45:53 +01:00
parent 6ddd411be8
commit 4aab47af38
No known key found for this signature in database
GPG key ID: 577982871529A52A
2 changed files with 3 additions and 3 deletions

View file

@ -17,8 +17,8 @@ else:
# Define startupinfo for subprocesses # Define startupinfo for subprocesses
if platform.system() == "Windows": if platform.system() == "Windows":
startupinfo = subprocess.STARTUPINFO() startupinfo = subprocess.STARTUPINFO() # type: ignore [attr-defined]
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore [attr-defined]
else: else:
startupinfo = None startupinfo = None

View file

@ -417,7 +417,7 @@ class GlobalCommon(object):
resource_path = prefix.joinpath(filename) resource_path = prefix.joinpath(filename)
return str(resource_path) return str(resource_path)
def get_subprocess_startupinfo(self): def get_subprocess_startupinfo(self): # type: ignore [no-untyped-def]
if platform.system() == "Windows": if platform.system() == "Windows":
startupinfo = subprocess.STARTUPINFO() startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW