Skip to content

Commit

Permalink
Merge pull request #412 from j-t-1/readability
Browse files Browse the repository at this point in the history
Increase readability and consistency
  • Loading branch information
erocarrera authored Aug 26, 2024
2 parents d92c698 + fa41978 commit 03c8c44
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ def parse_strings(data, counter, l):
l[counter] = data[i : i + len_ * 2].decode("utf-16le")
except UnicodeDecodeError:
error_count += 1
pass
if error_count >= 3:
break
i += len_ * 2
Expand Down Expand Up @@ -1129,10 +1128,10 @@ def dump_dict(self):
class SectionStructure(Structure):
"""Convenience section handling class."""

def __init__(self, *argl, **argd):
if "pe" in argd:
self.pe = argd["pe"]
del argd["pe"]
def __init__(self, *args, **kwargs):
if "pe" in kwargs:
self.pe = kwargs["pe"]
del kwargs["pe"]

self.PointerToRawData = None
self.VirtualAddress = None
Expand Down Expand Up @@ -1523,9 +1522,9 @@ def _pack_bitfield_attributes(self):
class DataContainer:
"""Generic data container."""

def __init__(self, **args):
def __init__(self, **kwargs):
bare_setattr = super().__setattr__
for key, value in args.items():
for key, value in kwargs.items():
bare_setattr(key, value)


Expand Down Expand Up @@ -5618,7 +5617,7 @@ def normalize_import_va(self, va):

# Try to avoid bogus VAs, which are out of the image.
# This also filters out entries that are zero
if begin_of_image <= va and va < end_of_image:
if begin_of_image <= va < end_of_image:
va -= begin_of_image
return va

Expand Down

0 comments on commit 03c8c44

Please sign in to comment.