| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 try: | 124 try: |
| 125 os.unlink(name) | 125 os.unlink(name) |
| 126 return | 126 return |
| 127 except OSError, e: | 127 except OSError, e: |
| 128 retry_count += 1 | 128 retry_count += 1 |
| 129 time.sleep(retry_count * 0.1) | 129 time.sleep(retry_count * 0.1) |
| 130 PrintError("os.unlink() " + str(e)) | 130 PrintError("os.unlink() " + str(e)) |
| 131 | 131 |
| 132 | 132 |
| 133 def Execute(args, verbose=False, timeout=None): | 133 def Execute(args, verbose=False, timeout=None): |
| 134 args = [ c for c in args if c != "" ] |
| 134 (fd_out, outname) = tempfile.mkstemp() | 135 (fd_out, outname) = tempfile.mkstemp() |
| 135 (fd_err, errname) = tempfile.mkstemp() | 136 (fd_err, errname) = tempfile.mkstemp() |
| 136 try: | 137 try: |
| 137 (exit_code, timed_out) = RunProcess( | 138 (exit_code, timed_out) = RunProcess( |
| 138 verbose, | 139 verbose, |
| 139 timeout, | 140 timeout, |
| 140 args=args, | 141 args=args, |
| 141 stdout=fd_out, | 142 stdout=fd_out, |
| 142 stderr=fd_err | 143 stderr=fd_err |
| 143 ) | 144 ) |
| 144 except: | 145 except: |
| 145 raise | 146 raise |
| 146 os.close(fd_out) | 147 os.close(fd_out) |
| 147 os.close(fd_err) | 148 os.close(fd_err) |
| 148 out = file(outname).read() | 149 out = file(outname).read() |
| 149 errors = file(errname).read() | 150 errors = file(errname).read() |
| 150 CheckedUnlink(outname) | 151 CheckedUnlink(outname) |
| 151 CheckedUnlink(errname) | 152 CheckedUnlink(errname) |
| 152 return output.Output(exit_code, timed_out, out, errors) | 153 return output.Output(exit_code, timed_out, out, errors) |
| OLD | NEW |