Skip to content

Commit

Permalink
Repair Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Jul 31, 2019
1 parent 4b3e251 commit b5f7511
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions allzpark/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,22 +1164,22 @@ def execute(self):
self.thread.start()

def _execute(self):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo = None
no_console = hasattr(allzparkconfig, "__noconsole__")

# Windows-only
# Prevent additional windows from appearing when running
# Allzpark without a console, e.g. via pythonw.exe.
if no_console and hasattr(subprocess, "STARTUPINFO"):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

kwargs = {
"command": self.cmd,
"stdout": subprocess.PIPE,
"stderr": subprocess.PIPE,
"parent_environ": None,

# Prevent additional windows from appearing when running
# Allzpark without a console, e.g. via pythonw.exe.
"startupinfo": (
startupinfo
if os.name == "nt" and hasattr(allzparkconfig, "__noconsole__")
else None
)
"startupinfo": startupinfo
}

context = self.context
Expand Down

0 comments on commit b5f7511

Please sign in to comment.