mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
pre-commit: run black without string normalization
This commit is contained in:
@@ -24,20 +24,26 @@ def run_subprocess(cmd, *args, **kwargs):
|
||||
and failed output directly to the user's screen
|
||||
"""
|
||||
logger = logging.getLogger('tljh')
|
||||
proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, *args, **kwargs)
|
||||
proc = subprocess.run(
|
||||
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, *args, **kwargs
|
||||
)
|
||||
printable_command = ' '.join(cmd)
|
||||
if proc.returncode != 0:
|
||||
# Our process failed! Show output to the user
|
||||
logger.error('Ran {command} with exit code {code}'.format(
|
||||
command=printable_command, code=proc.returncode
|
||||
))
|
||||
logger.error(
|
||||
'Ran {command} with exit code {code}'.format(
|
||||
command=printable_command, code=proc.returncode
|
||||
)
|
||||
)
|
||||
logger.error(proc.stdout.decode())
|
||||
raise subprocess.CalledProcessError(cmd=cmd, returncode=proc.returncode)
|
||||
else:
|
||||
# This goes into installer.log
|
||||
logger.debug('Ran {command} with exit code {code}'.format(
|
||||
command=printable_command, code=proc.returncode
|
||||
))
|
||||
logger.debug(
|
||||
'Ran {command} with exit code {code}'.format(
|
||||
command=printable_command, code=proc.returncode
|
||||
)
|
||||
)
|
||||
# This produces multi line log output, unfortunately. Not sure how to fix.
|
||||
# For now, prioritizing human readability over machine readability.
|
||||
logger.debug(proc.stdout.decode())
|
||||
|
||||
Reference in New Issue
Block a user