projects
/
pyelftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e987bd8
)
Fix determining PAGESIZE under Jython (#314)
author
mephi42
<mephi42@gmail.com>
Thu, 21 May 2020 12:18:17 +0000
(14:18 +0200)
committer
GitHub
<noreply@github.com>
Thu, 21 May 2020 12:18:17 +0000
(
05:18
-0700)
Jython has neither `resource` nor `mmap`, therefore just use a
reasonable default.
elftools/elf/elffile.py
patch
|
blob
|
history
diff --git
a/elftools/elf/elffile.py
b/elftools/elf/elffile.py
index f95fd54fb82d2538fb121eea17eb83c5a798ef1a..b7868f2e379f873f6ab9a23a35ab8e962c3c1c4f 100644
(file)
--- a/
elftools/elf/elffile.py
+++ b/
elftools/elf/elffile.py
@@
-14,9
+14,13
@@
try:
import resource
PAGESIZE = resource.getpagesize()
except ImportError:
- # Windows system
- import mmap
- PAGESIZE = mmap.PAGESIZE
+ try:
+ # Windows system
+ import mmap
+ PAGESIZE = mmap.PAGESIZE
+ except ImportError:
+ # Jython
+ PAGESIZE = 4096
from ..common.py3compat import BytesIO
from ..common.exceptions import ELFError