From 7523aca8cfd3386b846abc2f1942e4bdc061f485 Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:47:27 +0000 Subject: [PATCH] Remove long type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PEP 237 – Unifying Long Integers and Integers. --- pefile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pefile.py b/pefile.py index f804678..334b9cd 100644 --- a/pefile.py +++ b/pefile.py @@ -40,8 +40,6 @@ codecs.register_error("backslashreplace_", codecs.lookup_error("backslashreplace")) -long = int - # lru_cache with a shallow copy of the objects returned (list, dicts, ..) # we don't use deepcopy as it's _really_ slow and the data we retrieved using @@ -1062,7 +1060,7 @@ def dump(self, indentation=0): for keys in self.__keys__: for key in keys: val = getattr(self, key) - if isinstance(val, (int, long)): + if isinstance(val, int): if key.startswith("Signature_"): val_str = "{:<8X}".format(val) else: @@ -1112,7 +1110,7 @@ def dump_dict(self): for keys in self.__keys__: for key in keys: val = getattr(self, key) - if isinstance(val, (int, long)): + if isinstance(val, int): if key == "TimeDateStamp" or key == "dwTimeStamp": try: val = "0x%-8X [%s UTC]" % (