From 907a9c3514af6ef919747fab1569a582ede9484f Mon Sep 17 00:00:00 2001 From: "Seva Alekseyev (he/him)" Date: Tue, 12 Nov 2024 15:00:37 -0500 Subject: [PATCH] PAGESIZE replaced with a constant (#578) --- elftools/elf/elffile.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/elftools/elf/elffile.py b/elftools/elf/elffile.py index 5c5d47ec..c7154439 100644 --- a/elftools/elf/elffile.py +++ b/elftools/elf/elffile.py @@ -12,18 +12,6 @@ import struct import zlib -try: - import resource - PAGESIZE = resource.getpagesize() -except ImportError: - try: - # Windows system - import mmap - PAGESIZE = mmap.PAGESIZE - except ImportError: - # Jython - PAGESIZE = 4096 - from ..common.exceptions import ELFError, ELFParseError from ..common.utils import struct_parse, elf_assert from .structs import ELFStructs @@ -857,7 +845,7 @@ def _decompress_dwarf_section(section): decompressor = zlib.decompressobj() uncompressed_stream = BytesIO() while True: - chunk = section.stream.read(PAGESIZE) + chunk = section.stream.read(4096) if not chunk: break uncompressed_stream.write(decompressor.decompress(chunk))