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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 timeout_result = [False] | 104 timeout_result = [False] |
105 | 105 |
106 timer = Timer(timeout, kill_process, [process, timeout_result]) | 106 timer = Timer(timeout, kill_process, [process, timeout_result]) |
107 timer.start() | 107 timer.start() |
108 stdout, stderr = process.communicate() | 108 stdout, stderr = process.communicate() |
109 timer.cancel() | 109 timer.cancel() |
110 | 110 |
111 return output.Output( | 111 return output.Output( |
112 process.returncode, | 112 process.returncode, |
113 timeout_result[0], | 113 timeout_result[0], |
114 stdout, | 114 stdout.decode('utf-8', 'replace').encode('utf-8'), |
115 stderr, | 115 stderr.decode('utf-8', 'replace').encode('utf-8'), |
116 process.pid, | 116 process.pid, |
117 ) | 117 ) |
118 | 118 |
119 | 119 |
120 def Execute(args, verbose=False, timeout=None): | 120 def Execute(args, verbose=False, timeout=None): |
121 args = [ c for c in args if c != "" ] | 121 args = [ c for c in args if c != "" ] |
122 return RunProcess(verbose, timeout, args=args) | 122 return RunProcess(verbose, timeout, args=args) |
OLD | NEW |