1- """Some backported features for subprocess
2- """
1+ """Some backported features for subprocess."""
32
43from __future__ import absolute_import
54import sys
6- import subprocess # @UnusedImport
7- from subprocess import (Popen , PIPE , STDOUT , CalledProcessError , # @UnusedImport
8- call , check_call , check_output ) # @UnusedImport
5+ import subprocess
6+ from subprocess import (Popen , PIPE , STDOUT , CalledProcessError ,
7+ call , check_call , check_output )
98if sys .platform == 'win32' :
10- from subprocess import STARTUPINFO # @UnusedImport
11- from subprocess import * # @UnusedWildImport
9+ from subprocess import STARTUPINFO
10+ from subprocess import *
1211
1312
1413try :
15- TimeoutExpired # @UndefinedVariable
14+ TimeoutExpired
1615except NameError :
17- import time # @Reimport
16+ import time
1817
1918 class SubprocessError (Exception ):
2019
@@ -27,6 +26,7 @@ class CalledProcessError(SubprocessError):
2726 Returns a non-zero exit status.
2827
2928 """
29+
3030 def __init__ (self , returncode , cmd , output = None ):
3131 self .returncode = returncode
3232 self .cmd = cmd
@@ -40,6 +40,7 @@ class TimeoutExpired(SubprocessError):
4040
4141 """Raised when the timeout expires while waiting for a child
4242 process."""
43+
4344 def __init__ (self , cmd , timeout , output = None ):
4445 self .cmd = cmd
4546 self .timeout = timeout
@@ -65,7 +66,7 @@ def Popen_wait(self, timeout=None):
6566 time .sleep (0.01 )
6667 return self .returncode
6768
68- def Popen_communicate (self , input = None , timeout = None ): # @ReservedAssignment
69+ def Popen_communicate (self , input = None , timeout = None ):
6970 """Interact with process."""
7071 if timeout is not None :
7172 self .wait (timeout )
0 commit comments