Skip to content

Commit

Permalink
Remove long type
Browse files Browse the repository at this point in the history
PEP 237 – Unifying Long Integers and Integers.
  • Loading branch information
j-t-1 authored Dec 15, 2024
1 parent 4b3b1e2 commit 7523aca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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]" % (
Expand Down

0 comments on commit 7523aca

Please sign in to comment.