Improve string formatting v5 (#33697)

* Improve string formatting v5

* Address review comments
This commit is contained in:
springstan 2020-04-05 17:48:55 +02:00 committed by GitHub
parent 39336d3ea3
commit fca90a8ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 221 additions and 252 deletions

View file

@ -61,7 +61,7 @@ async def async_exec(*args, display=False):
argsp = []
for arg in args:
if os.path.isfile(arg):
argsp.append("\\\n {}".format(shlex.quote(arg)))
argsp.append(f"\\\n {shlex.quote(arg)}")
else:
argsp.append(shlex.quote(arg))
printc("cyan", *argsp)
@ -75,9 +75,7 @@ async def async_exec(*args, display=False):
kwargs["stderr"] = asyncio.subprocess.PIPE
proc = await asyncio.create_subprocess_exec(*args, **kwargs)
except FileNotFoundError as err:
printc(
FAIL, f"Could not execute {args[0]}. Did you install test requirements?",
)
printc(FAIL, f"Could not execute {args[0]}. Did you install test requirements?")
raise err
if not display: