Skip to content

Commit b4d88df

Browse files
authored
Update x.py
Refactor string formatting by replacing str.format() with f-strings for improved readability and efficiency.
1 parent ab3924b commit b4d88df

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

x.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@
3131

3232
# soft deprecation of old python versions
3333
skip_check = os.environ.get("RUST_IGNORE_OLD_PYTHON") == "1"
34-
if not skip_check and (major < 3 or (major == 3 and minor < 6)):
35-
msg = cleandoc(
36-
"""
37-
Using python {}.{} but >= 3.6 is recommended. Your python version
38-
should continue to work for the near future, but this will
39-
eventually change. If python >= 3.6 is not available on your system,
40-
please file an issue to help us understand timelines.
41-
42-
This message can be suppressed by setting `RUST_IGNORE_OLD_PYTHON=1`
43-
""".format(major, minor)
44-
)
45-
warnings.warn(msg, stacklevel=1)
34+
if not skip_check and (major < 3 or (major == 3 and minor < 6)):
35+
msg = cleandoc(f"""
36+
Using python {major}.{minor} but >= 3.6 is recommended. Your python version
37+
should continue to work for the near future, but this will
38+
eventually change. If python >= 3.6 is not available on your system,
39+
please file an issue to help us understand timelines.
40+
41+
This message can be suppressed by setting `RUST_IGNORE_OLD_PYTHON=1`
42+
""")
43+
warnings.warn(msg, stacklevel=1)
4644

4745
rust_dir = os.path.dirname(os.path.abspath(__file__))
4846
# For the import below, have Python search in src/bootstrap first.

0 commit comments

Comments
 (0)