From 45b71f9f999021740f0ea8b627df321b2027e0a2 Mon Sep 17 00:00:00 2001 From: Seva Alekseyev Date: Tue, 12 Nov 2024 14:05:39 -0500 Subject: [PATCH] PAGESIZE replaced with a constant --- 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))