Merge pull request #1957 from aanand/stub-run-on-windows

WIP: Build Windows binary
This commit is contained in:
mnowster 2015-09-21 16:21:12 +01:00
commit aa70209ade
3 changed files with 47 additions and 6 deletions

View file

@ -66,7 +66,12 @@ def call_silently(*args, **kwargs):
Like subprocess.call(), but redirects stdout and stderr to /dev/null.
"""
with open(os.devnull, 'w') as shutup:
return subprocess.call(*args, stdout=shutup, stderr=shutup, **kwargs)
try:
return subprocess.call(*args, stdout=shutup, stderr=shutup, **kwargs)
except WindowsError:
# On Windows, subprocess.call() can still raise exceptions. Normalize
# to POSIXy behaviour by returning a nonzero exit code.
return 1
def is_mac():