Skip to content

Commit b8ffc88

Browse files
committed
Use f-strings
1 parent 496c69c commit b8ffc88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ def _stamp_version(filename: str) -> None:
4747
with open(filename) as f:
4848
for line in f:
4949
if "__version__ =" in line:
50-
line = line.replace("\"git\"", "'%s'" % VERSION)
50+
line = line.replace("\"git\"", f"'{VERSION}'")
5151
found = True
5252
out.append(line)
5353
except OSError:
54-
print("Couldn't find file %s to stamp version" % filename, file=sys.stderr)
54+
print(f"Couldn't find file {filename} to stamp version", file=sys.stderr)
5555

5656
if found:
5757
with open(filename, "w") as f:
5858
f.writelines(out)
5959
else:
60-
print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr)
60+
print(f"WARNING: Couldn't find version line in file {filename}", file=sys.stderr)
6161

6262

6363
def build_py_modules(basedir: str, excludes: Sequence = ()) -> Sequence:

0 commit comments

Comments
 (0)