File tree Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Original file line number Diff line number Diff line change 9
9
import os
10
10
import re
11
11
import subprocess
12
+ from subprocess import check_output
12
13
import sys
13
14
import warnings
14
15
from textwrap import fill
19
20
PY3 = (sys .version_info [0 ] >= 3 )
20
21
21
22
22
- try :
23
- from subprocess import check_output
24
- except ImportError :
25
- # check_output is not available in Python 2.6
26
- def check_output (* popenargs , ** kwargs ):
27
- """
28
- Run command with arguments and return its output as a byte
29
- string.
30
-
31
- Backported from Python 2.7 as it's implemented as pure python
32
- on stdlib.
33
- """
3
98D0
4
- process = subprocess .Popen (
35
- stdout = subprocess .PIPE , * popenargs , ** kwargs )
36
- output , unused_err = process .communicate ()
37
- retcode = process .poll ()
38
- if retcode :
39
- cmd = kwargs .get ("args" )
40
- if cmd is None :
41
- cmd = popenargs [0 ]
42
- error = subprocess .CalledProcessError (retcode , cmd )
43
- error .output = output
44
- raise error
45
- return output
46
-
47
-
48
23
if sys .platform != 'win32' :
49
24
if sys .version_info [0 ] < 3 :
50
25
from commands import getstatusoutput
You can’t perform that action at this time.
0 commit comments