Skip to content

Commit 52cd382

Browse files
committed
Remove unused code
1 parent 6ddad17 commit 52cd382

1 file changed

Lines changed: 11 additions & 27 deletions

File tree

‎language_check/backports/subprocess.py‎

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
11
"""Some backported features for subprocess."""
22

33
from __future__ import absolute_import
4+
45
import sys
5-
import subprocess
6-
from subprocess import (Popen, PIPE, STDOUT, CalledProcessError,
7-
call, check_call, check_output)
6+
import time
7+
8+
from subprocess import Popen, PIPE, STDOUT, check_call, check_output
9+
810
if sys.platform == 'win32':
911
from subprocess import STARTUPINFO
10-
from subprocess import *
11-
12+
assert STARTUPINFO
1213

13-
try:
14-
TimeoutExpired
15-
except NameError:
16-
import time
14+
assert check_call
15+
assert check_output
16+
assert PIPE
17+
assert STDOUT
1718

19+
if sys.version_info[0] == 2:
1820
class SubprocessError(Exception):
1921

2022
"""Exception classes used by this module."""
2123

22-
class CalledProcessError(SubprocessError):
23-
24-
"""Raised when a process run by check_call() or check_output().
25-
26-
Returns a non-zero exit status.
27-
28-
"""
29-
30-
def __init__(self, returncode, cmd, output=None):
31-
self.returncode = returncode
32-
self.cmd = cmd
33-
self.output = output
34-
35-
def __str__(self):
36-
return ("Command '%s' returned non-zero exit status %d" %
37-
(self.cmd, self.returncode))
38-
3924
class TimeoutExpired(SubprocessError):
4025

4126
"""Raised when the timeout expires while waiting for a child
@@ -72,7 +57,6 @@ def Popen_communicate(self, input=None, timeout=None):
7257
self.wait(timeout)
7358
return _Popen_communicate(self, input)
7459

75-
subprocess.CalledProcessError = CalledProcessError
7660
_Popen_init = Popen.__init__
7761
_Popen_wait = Popen.wait
7862
_Popen_communicate = Popen.communicate

0 commit comments

Comments
 (0)