OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 popen_args = args | 54 popen_args = args |
55 prev_error_mode = SEM_INVALID_VALUE | 55 prev_error_mode = SEM_INVALID_VALUE |
56 if utils.IsWindows(): | 56 if utils.IsWindows(): |
57 popen_args = subprocess.list2cmdline(args) | 57 popen_args = subprocess.list2cmdline(args) |
58 # Try to change the error mode to avoid dialogs on fatal errors. Don't | 58 # Try to change the error mode to avoid dialogs on fatal errors. Don't |
59 # touch any existing error mode flags by merging the existing error mode. | 59 # touch any existing error mode flags by merging the existing error mode. |
60 # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx. | 60 # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx. |
61 error_mode = SEM_NOGPFAULTERRORBOX | 61 error_mode = SEM_NOGPFAULTERRORBOX |
62 prev_error_mode = Win32SetErrorMode(error_mode) | 62 prev_error_mode = Win32SetErrorMode(error_mode) |
63 Win32SetErrorMode(error_mode | prev_error_mode) | 63 Win32SetErrorMode(error_mode | prev_error_mode) |
64 process = subprocess.Popen( | 64 |
65 args=popen_args, | 65 try: |
66 stdout=subprocess.PIPE, | 66 process = subprocess.Popen( |
67 stderr=subprocess.PIPE, | 67 args=popen_args, |
68 **rest | 68 stdout=subprocess.PIPE, |
69 ) | 69 stderr=subprocess.PIPE, |
| 70 **rest |
| 71 ) |
| 72 except Exception as e: |
| 73 sys.stderr.write("Error executing: %s\n" % popen_args) |
| 74 raise e |
| 75 |
70 if (utils.IsWindows() and prev_error_mode != SEM_INVALID_VALUE): | 76 if (utils.IsWindows() and prev_error_mode != SEM_INVALID_VALUE): |
71 Win32SetErrorMode(prev_error_mode) | 77 Win32SetErrorMode(prev_error_mode) |
72 | 78 |
73 def kill_process(process, timeout_result): | 79 def kill_process(process, timeout_result): |
74 timeout_result[0] = True | 80 timeout_result[0] = True |
75 try: | 81 try: |
76 if utils.IsWindows(): | 82 if utils.IsWindows(): |
77 if verbose: | 83 if verbose: |
78 print "Attempting to kill process %d" % process.pid | 84 print "Attempting to kill process %d" % process.pid |
79 sys.stdout.flush() | 85 sys.stdout.flush() |
(...skipping 25 matching lines...) Expand all Loading... |
105 | 111 |
106 | 112 |
107 def Execute(args, verbose=False, timeout=None): | 113 def Execute(args, verbose=False, timeout=None): |
108 args = [ c for c in args if c != "" ] | 114 args = [ c for c in args if c != "" ] |
109 exit_code, timed_out, stdout, stderr = RunProcess( | 115 exit_code, timed_out, stdout, stderr = RunProcess( |
110 verbose, | 116 verbose, |
111 timeout, | 117 timeout, |
112 args=args, | 118 args=args, |
113 ) | 119 ) |
114 return output.Output(exit_code, timed_out, stdout, stderr) | 120 return output.Output(exit_code, timed_out, stdout, stderr) |
OLD | NEW |