File tree 1 file changed +2
-13
lines changed
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 25
25
26
26
from __future__ import print_function
27
27
28
+ from subprocess import check_output
28
29
from requests .auth import HTTPBasicAuth
29
30
import requests
30
31
31
32
import os
32
33
import six
33
- import subprocess
34
34
import sys
35
35
import textwrap
36
36
@@ -83,21 +83,10 @@ def fail(msg):
83
83
84
84
85
85
def run_cmd (cmd ):
86
- # py2.6 does not have subprocess.check_output
87
86
if isinstance (cmd , six .string_types ):
88
87
cmd = cmd .split (' ' )
89
88
90
- popenargs = [cmd ]
91
- kwargs = {}
92
-
93
- process = subprocess .Popen (stdout = subprocess .PIPE , * popenargs )
94
- output , unused_err = process .communicate ()
95
- retcode = process .poll ()
96
- if retcode :
97
- cmd = kwargs .get ("args" )
98
- if cmd is None :
99
- cmd = popenargs [0 ]
100
- raise subprocess .CalledProcessError (retcode , cmd , output = output )
89
+ output = check_output (cmd )
101
90
102
91
if isinstance (output , six .binary_type ):
103
92
output = output .decode ('utf-8' )
You can’t perform that action at this time.
0 commit comments