From 5ebf60d0ea318892008a677107c9bcef0ff10000 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Fri, 20 Dec 2024 16:01:36 +0100 Subject: [PATCH] reset python2 compatibility in setup.py --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 0a585c9a2..148bfcfdf 100755 --- a/setup.py +++ b/setup.py @@ -212,7 +212,7 @@ def missdeps(cmdline): else: s += ". Perhaps Python header files are not installed. " s += "Try running:\n" - s += f" {cmdline}" + s += " %s" % cmdline print(hilite(s, color="red", bold=True), file=sys.stderr) @@ -247,7 +247,7 @@ def unix_can_compile(c_code): def get_winver(): maj, min = sys.getwindowsversion()[0:2] - return f"0x0{maj * 100 + min}" + return '0x0%s' % ((maj * 100) + min) if sys.getwindowsversion()[0] < 6: msg = "this Windows version is too old (< Windows Vista); " @@ -429,7 +429,7 @@ def get_winver(): ) else: - sys.exit(f"platform {sys.platform} is not supported") + sys.exit('platform %s is not supported' % sys.platform) if POSIX: @@ -568,12 +568,13 @@ def main(): if LINUX: pyimpl = "pypy" if PYPY else "python" if shutil.which("dpkg"): - missdeps(f"sudo apt-get install gcc {pyimpl}3-dev") + missdeps("sudo apt-get install gcc %s3-dev" % (pyimpl)) elif shutil.which("rpm"): - missdeps(f"sudo yum install gcc {pyimpl}-devel") + missdeps("sudo yum install gcc %s-devel" % (pyimpl)) elif shutil.which("apk"): missdeps( - f"sudo apk add gcc {pyimpl}-dev musl-dev linux-headers" + "sudo apk add gcc %s%s-dev musl-dev linux-headers" + % (pyimpl) ) elif MACOS: msg = (