diff --git a/elftools/elf/elffile.py b/elftools/elf/elffile.py index 5c5d47ec..935b7d68 100644 --- a/elftools/elf/elffile.py +++ b/elftools/elf/elffile.py @@ -12,10 +12,16 @@ import struct import zlib +PAGESIZE = None try: import resource PAGESIZE = resource.getpagesize() except ImportError: + pass +except AttributeError: # may raise AttributeError when running as packaged app (packed by pyinstaller) + pass + +if PAGESIZE is None: try: # Windows system import mmap