(argv, *,
#capture_output=True,
stdout=subprocess.PIPE,
#stderr=subprocess.STDOUT,
stderr=subprocess.PIPE,
text=True,
check=True,
**kwargs
)
| 25 | |
| 26 | |
| 27 | def run_cmd(argv, *, |
| 28 | #capture_output=True, |
| 29 | stdout=subprocess.PIPE, |
| 30 | #stderr=subprocess.STDOUT, |
| 31 | stderr=subprocess.PIPE, |
| 32 | text=True, |
| 33 | check=True, |
| 34 | **kwargs |
| 35 | ): |
| 36 | if isinstance(stderr, str) and stderr.lower() == 'stdout': |
| 37 | stderr = subprocess.STDOUT |
| 38 | |
| 39 | kw = dict(locals()) |
| 40 | kw.pop('argv') |
| 41 | kw.pop('kwargs') |
| 42 | kwargs.update(kw) |
| 43 | |
| 44 | # Remove LANG environment variable: the C parser doesn't support GCC |
| 45 | # localized messages |
| 46 | env = dict(os.environ) |
| 47 | env.pop('LANG', None) |
| 48 | |
| 49 | proc = subprocess.run(argv, env=env, **kwargs) |
| 50 | return proc.stdout |
| 51 | |
| 52 | |
| 53 | def preprocess(tool, filename, cwd=None, **kwargs): |
searching dependent graphs…