OLD | NEW |
1 # coding=utf8 | 1 # coding=utf8 |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 """Collection of subprocess wrapper functions. | 5 """Collection of subprocess wrapper functions. |
6 | 6 |
7 In theory you shouldn't need anything else in subprocess, or this module failed. | 7 In theory you shouldn't need anything else in subprocess, or this module failed. |
8 """ | 8 """ |
9 | 9 |
10 from __future__ import with_statement | |
11 import cStringIO | 10 import cStringIO |
12 import errno | 11 import errno |
13 import logging | 12 import logging |
14 import os | 13 import os |
15 import Queue | 14 import Queue |
16 import subprocess | 15 import subprocess |
17 import sys | 16 import sys |
18 import time | 17 import time |
19 import threading | 18 import threading |
20 | 19 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 440 |
442 - Throws if return code is not 0. | 441 - Throws if return code is not 0. |
443 - Works even prior to python 2.7. | 442 - Works even prior to python 2.7. |
444 - Blocks stdin by default if not specified since no output will be visible. | 443 - Blocks stdin by default if not specified since no output will be visible. |
445 - As per doc, "The stdout argument is not allowed as it is used internally." | 444 - As per doc, "The stdout argument is not allowed as it is used internally." |
446 """ | 445 """ |
447 kwargs.setdefault('stdin', VOID) | 446 kwargs.setdefault('stdin', VOID) |
448 if 'stdout' in kwargs: | 447 if 'stdout' in kwargs: |
449 raise ValueError('stdout argument not allowed, it will be overridden.') | 448 raise ValueError('stdout argument not allowed, it will be overridden.') |
450 return check_call_out(args, stdout=PIPE, **kwargs)[0] | 449 return check_call_out(args, stdout=PIPE, **kwargs)[0] |
OLD | NEW |