Skip to content

Commit

Permalink
Removed duplicate seek test (#593)
Browse files Browse the repository at this point in the history
Function `get_base_class_and_magic_number()` already tests the value of `seek`, followed by a `seek()` call if needed. No need to duplicate the code in calling function `read_mach_header()`.
  • Loading branch information
DimitriPapadopoulos committed Mar 10, 2024
1 parent 0624fc8 commit e8d91cf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/wheel/macosx_libfile.py
Expand Up @@ -340,9 +340,7 @@ def read_mach_header(lib_file, seek=None):
:param lib_file: reference to opened library file with pointer
"""
if seek is not None:
lib_file.seek(seek)
base_class, magic_number = get_base_class_and_magic_number(lib_file)
base_class, magic_number = get_base_class_and_magic_number(lib_file, seek)
arch = "32" if magic_number == MH_MAGIC else "64"

class SegmentBase(base_class):
Expand Down

0 comments on commit e8d91cf

Please sign in to comment.