Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use not in operator #414

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ def get_bits_left(self):
ac = Accumulator(old_fmt, comp_fields)

for elm in format[1]:
if not ":" in elm:
if ":" not in elm:
ac.wrap_up()
old_fmt.append(elm)
continue
Expand All @@ -1400,7 +1400,7 @@ def get_bits_left(self):

extended_keys = []
for idx, val in enumerate(keys):
if not idx in comp_fields:
if idx not in comp_fields:
extended_keys.append(val)
continue
_, sbf = comp_fields[idx]
Expand Down Expand Up @@ -3833,7 +3833,7 @@ def parse_exceptions_directory(self, rva, size):
continue
if not hasattr(rf.unwindinfo, "FunctionEntry"):
continue
if not rf.unwindinfo.FunctionEntry in rva2rt:
if rf.unwindinfo.FunctionEntry not in rva2rt:
self.__warnings.append(
f"FunctionEntry of UNWIND_INFO at {rf.struct.get_file_offset():x}"
" points to an entry that does not exist"
Expand Down Expand Up @@ -5541,7 +5541,7 @@ def length_until_eof(rva):
symbol_counts = collections.defaultdict(int)
export_parsing_loop_completed_normally = True
for idx in range(min(export_dir.NumberOfFunctions, int(safety_boundary / 4))):
if not idx + export_dir.Base in ordinals:
if idx + export_dir.Base not in ordinals:
try:
symbol_address = self.get_dword_from_data(address_of_functions, idx)
except PEFormatError:
Expand Down
Loading