Commits

Keith Holman  committed 8e9f6b6 Merge

Accepting pull request: Do not use Windows-specific flags when not running on Windows.

  • Participants
  • Parent commits 7175330, 1a3e28a

Comments (0)

Files changed (1)

     """Run the specified command, block until it completes, and return
     the exit code, stdout, and stderr.
     Additional parameters to Popen can be specified as keyword parameters."""
-    startupinfo = subprocess.STARTUPINFO()
-    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+    if subprocess.mswindows:
+        startupinfo = subprocess.STARTUPINFO()
+        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+        popen_kwargs['startupinfo'] = startupinfo
     process = subprocess.Popen(
         command,
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
-        startupinfo=startupinfo,
         **popen_kwargs)
     stdout, stderr = process.communicate()
     exit_code = process.wait()