Skip to content

Commit 907a9c3

Browse files
authored
PAGESIZE replaced with a constant (#578)
1 parent d0b50a2 commit 907a9c3

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

elftools/elf/elffile.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212
import struct
1313
import zlib
1414

15-
try:
16-
import resource
17-
PAGESIZE = resource.getpagesize()
18-
except ImportError:
19-
try:
20-
# Windows system
21-
import mmap
22-
PAGESIZE = mmap.PAGESIZE
23-
except ImportError:
24-
# Jython
25-
PAGESIZE = 4096
26-
2715
from ..common.exceptions import ELFError, ELFParseError
2816
from ..common.utils import struct_parse, elf_assert
2917
from .structs import ELFStructs
@@ -857,7 +845,7 @@ def _decompress_dwarf_section(section):
857845
decompressor = zlib.decompressobj()
858846
uncompressed_stream = BytesIO()
859847
while True:
860-
chunk = section.stream.read(PAGESIZE)
848+
chunk = section.stream.read(4096)
861849
if not chunk:
862850
break
863851
uncompressed_stream.write(decompressor.decompress(chunk))

0 commit comments

Comments
 (0)