Conditions | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
19 | 1 | def output_command(args, cwd=None): |
|
20 | """ |
||
21 | run a shell command and return its output |
||
22 | """ |
||
23 | 1 | try: |
|
24 | 1 | output = subprocess.check_output( |
|
25 | args, |
||
26 | cwd=cwd, |
||
27 | universal_newlines=True, |
||
28 | stderr=subprocess.STDOUT) |
||
29 | 1 | except CalledProcessError: |
|
30 | 1 | output = '' |
|
31 | |||
32 | 1 | return output if PY3 else output.decode('utf-8') |
|
33 | |||
39 |