From b33c3e948b72f71176cd57afd2085835bab64ff7 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 13 Jul 2023 22:01:46 +0100 Subject: Use removesuffix --- tools/map.py | 2 +- tools/pngpal.py | 2 +- tools/pngpix.py | 2 +- tools/raw.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/map.py b/tools/map.py index 034a4b5..825f307 100755 --- a/tools/map.py +++ b/tools/map.py @@ -104,7 +104,7 @@ def main(): # end of entity list out.append(0xFF) - tmp = args.output.rstrip(".o") + tmp = args.output.removesuffix(".o") with open(tmp, "wb") as fd: fd.write(bytearray(out)) fd.flush() diff --git a/tools/pngpal.py b/tools/pngpal.py index 5e08373..c4d43d6 100755 --- a/tools/pngpal.py +++ b/tools/pngpal.py @@ -37,7 +37,7 @@ def main(): if not palette: parser.error("failed to extract the palette") - tmp = args.output.rstrip(".o") + tmp = args.output.removesuffix(".o") with open(tmp, "wb") as fd: fd.write(bytearray(palette)) fd.flush() diff --git a/tools/pngpix.py b/tools/pngpix.py index e803b82..67f8755 100755 --- a/tools/pngpix.py +++ b/tools/pngpix.py @@ -37,7 +37,7 @@ def main(): if not data: parser.error("failed to extract the pixel data") - tmp = args.output.rstrip(".o") + tmp = args.output.removesuffix(".o") with open(tmp, "wb") as fd: fd.write(bytearray(data)) fd.flush() diff --git a/tools/raw.py b/tools/raw.py index 755a64c..35a8dec 100755 --- a/tools/raw.py +++ b/tools/raw.py @@ -27,7 +27,7 @@ def main(): with open(args.file, "rb") as fd: data = fd.read() - tmp = args.output.rstrip(".o") + tmp = args.output.removesuffix(".o") with open(tmp, "wb") as fd: fd.write(bytearray(data)) fd.flush() -- cgit v1.2.3