Skip to content

Commit

Permalink
Handle WindowsError exception in subprocess.Popen called from _run_argv
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo J. A. M. Carneiro committed Jun 24, 2009
1 parent dba53a8 commit 4b6439b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,15 @@ def run_argv(argv, env, os_env=None, cwd=None, force_no_valgrind=False):
if retval == 0 and error:
retval = 1
else:
retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait()
try:
WindowsError
except NameError:
retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait()
else:
try:
retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait()
except WindowsError, ex:
raise Utils.WafError("Command %s raised exception %s" % (argv, ex))
if retval:
raise Utils.WafError("Command %s exited with code %i" % (argv, retval))
return retval
Expand Down

0 comments on commit 4b6439b

Please sign in to comment.