diff --git a/pandas/tests/tseries/frequencies/test_to_offset.py b/pandas/tests/tseries/frequencies/test_to_offset.py index b6069c446160d..beaefe9109e91 100644 --- a/pandas/tests/tseries/frequencies/test_to_offset.py +++ b/pandas/tests/tseries/frequencies/test_to_offset.py @@ -86,7 +86,7 @@ def test_to_offset_invalid(freqstr): # We escape string because some of our # inputs contain regex special characters. - msg = re.escape("Invalid frequency: {freqstr}".format(freqstr=freqstr)) + msg = re.escape(f"Invalid frequency: {freqstr}") with pytest.raises(ValueError, match=msg): frequencies.to_offset(freqstr) diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index 2801a2bf9c371..fdfa436ce6536 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -43,7 +43,8 @@ def get_sys_info() -> List[Tuple[str, Optional[Union[str, int]]]]: ("python-bits", struct.calcsize("P") * 8), ("OS", f"{sysname}"), ("OS-release", f"{release}"), - # ("Version", "{version}".format(version=version)), + # FIXME: dont leave commented-out + # ("Version", f"{version}"), ("machine", f"{machine}"), ("processor", f"{processor}"), ("byteorder", f"{sys.byteorder}"), @@ -114,14 +115,13 @@ def show_versions(as_json=False): else: maxlen = max(len(x) for x in deps) - tpl = "{{k:<{maxlen}}}: {{stat}}".format(maxlen=maxlen) print("\nINSTALLED VERSIONS") print("------------------") for k, stat in sys_info: - print(tpl.format(k=k, stat=stat)) + print(f"{{k:<{maxlen}}}: {{stat}}") print("") for k, stat in deps_blob: - print(tpl.format(k=k, stat=stat)) + print(f"{{k:<{maxlen}}}: {{stat}}") def main() -> int: