Skip to content

Commit

Permalink
chore(python): migrate string format (#5043)
Browse files Browse the repository at this point in the history
From percent to f-string.
  • Loading branch information
Rotzbua committed Mar 22, 2024
1 parent 1a22cf8 commit d92d9c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/shouldfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def createImport(inputfile, scadfile):
try:
result = subprocess.call(export_cmd)
except (OSError) as err:
failquit("Error: %s \"%s\"" % (err.strerror, export_cmd))
failquit(f'Error: {err.strerror} "{export_cmd}"')

if str(result) != str(args.retval):
failquit('OpenSCAD failed with unexpected return value ' + str(result) + ' (should be ' + str(args.retval) + ')')
4 changes: 2 additions & 2 deletions tests/test_cmdline_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def verify_test(testname, cmd):
global expectedfilename, actualfilename
if not options.generate:
if not os.path.isfile(expectedfilename):
print("Error: test '%s' is missing expected output in %s" % (testname, expectedfilename), file=sys.stderr)
print(f"Error: test '{testname}' is missing expected output in {expectedfilename}", file=sys.stderr)
# next 2 imgs parsed by test_pretty_print.py
print(' actual image: ' + actualfilename + '\n', file=sys.stderr)
print(' expected image: ' + expectedfilename + '\n', file=sys.stderr)
Expand Down Expand Up @@ -329,7 +329,7 @@ def run_test(testname, cmd, args, redirect_stdin=False, redirect_stdout=False):

return outputname
except (OSError) as err:
print("Error: %s \"%s\"" % (err.strerror, cmd), file=sys.stderr)
print(f'Error: {err.strerror} "{cmd}"', file=sys.stderr)
return None

class Options:
Expand Down

0 comments on commit d92d9c2

Please sign in to comment.