mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Remove unused __popen DI
This commit is contained in:
parent
520604939a
commit
e55f51fb14
1 changed files with 1 additions and 2 deletions
|
|
@ -144,7 +144,6 @@ class CalledProcessError(RuntimeError):
|
||||||
def cmd_output(*cmd, **kwargs):
|
def cmd_output(*cmd, **kwargs):
|
||||||
retcode = kwargs.pop('retcode', 0)
|
retcode = kwargs.pop('retcode', 0)
|
||||||
encoding = kwargs.pop('encoding', 'UTF-8')
|
encoding = kwargs.pop('encoding', 'UTF-8')
|
||||||
__popen = kwargs.pop('__popen', subprocess.Popen)
|
|
||||||
|
|
||||||
popen_kwargs = {
|
popen_kwargs = {
|
||||||
'stdin': subprocess.PIPE,
|
'stdin': subprocess.PIPE,
|
||||||
|
|
@ -165,7 +164,7 @@ def cmd_output(*cmd, **kwargs):
|
||||||
returncode, stdout, stderr = e.to_output()
|
returncode, stdout, stderr = e.to_output()
|
||||||
else:
|
else:
|
||||||
popen_kwargs.update(kwargs)
|
popen_kwargs.update(kwargs)
|
||||||
proc = __popen(cmd, **popen_kwargs)
|
proc = subprocess.Popen(cmd, **popen_kwargs)
|
||||||
stdout, stderr = proc.communicate()
|
stdout, stderr = proc.communicate()
|
||||||
returncode = proc.returncode
|
returncode = proc.returncode
|
||||||
if encoding is not None and stdout is not None:
|
if encoding is not None and stdout is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue