From 6a62e0cb0dfe9cd28b70547dbea5caf76847c3a9 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 19 Dec 2021 01:31:09 -0500 Subject: [PATCH] scripts: Remove python23compat.py It's simpler to use b"" designations around binary strings than to use the as_bytes() function. Signed-off-by: Kevin O'Connor --- scripts/buildrom.py | 6 ++---- scripts/checkrom.py | 4 +--- scripts/python23compat.py | 14 -------------- 3 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 scripts/python23compat.py diff --git a/scripts/buildrom.py b/scripts/buildrom.py index 0499049c..48bfc177 100755 --- a/scripts/buildrom.py +++ b/scripts/buildrom.py @@ -7,8 +7,6 @@ import sys, struct -from python23compat import as_bytes - def alignpos(pos, alignbytes): mask = alignbytes - 1 return (pos + mask) & ~mask @@ -31,7 +29,7 @@ def main(): count = len(data) # Pad to a 512 byte boundary - data += as_bytes("\0") * (alignpos(count, 512) - count) + data += b"\0" * (alignpos(count, 512) - count) count = len(data) # Check if a pci header is present @@ -42,7 +40,7 @@ def main(): # Fill in size field; clear checksum field blocks = struct.pack(' -# -# This file may be distributed under the terms of the GNU GPLv3 license. - -import sys - -if (sys.version_info > (3, 0)): - def as_bytes(str): - return bytes(str, "ASCII") -else: - def as_bytes(str): - return str