mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 21:04:17 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
72ad6dc953
commit
f4cd1ba0d6
813 changed files with 66015 additions and 58839 deletions
|
|
@ -5,14 +5,16 @@ specific functions for launching another program in a sub-process.
|
|||
Also provides the 'find_executable()' to search the path for a given
|
||||
executable name.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from distutils.errors import DistutilsPlatformError, DistutilsExecError
|
||||
from distutils.debug import DEBUG
|
||||
from distutils import log
|
||||
from distutils.debug import DEBUG
|
||||
from distutils.errors import DistutilsExecError
|
||||
from distutils.errors import DistutilsPlatformError
|
||||
|
||||
|
||||
def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None):
|
||||
|
|
@ -60,13 +62,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None):
|
|||
if not DEBUG:
|
||||
cmd = cmd[0]
|
||||
raise DistutilsExecError(
|
||||
"command %r failed: %s" % (cmd, exc.args[-1])) from exc
|
||||
'command {!r} failed: {}'.format(cmd, exc.args[-1]),
|
||||
) from exc
|
||||
|
||||
if exitcode:
|
||||
if not DEBUG:
|
||||
cmd = cmd[0]
|
||||
raise DistutilsExecError(
|
||||
"command %r failed with exit code %s" % (cmd, exitcode))
|
||||
'command {!r} failed with exit code {}'.format(cmd, exitcode),
|
||||
)
|
||||
|
||||
|
||||
def find_executable(executable, path=None):
|
||||
|
|
@ -86,7 +90,7 @@ def find_executable(executable, path=None):
|
|||
path = os.environ.get('PATH', None)
|
||||
if path is None:
|
||||
try:
|
||||
path = os.confstr("CS_PATH")
|
||||
path = os.confstr('CS_PATH')
|
||||
except (AttributeError, ValueError):
|
||||
# os.confstr() or CS_PATH is not available
|
||||
path = os.defpath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue