Skip to content

Commit

Permalink
Examples should prefer local pyelftools to installed one
Browse files Browse the repository at this point in the history
  • Loading branch information
eliben committed Apr 10, 2013
1 parent 69c3a90 commit cc1e557
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 54 deletions.
9 changes: 3 additions & 6 deletions examples/dwarf_decode_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import maxint, bytes2str
from elftools.elf.elffile import ELFFile
Expand Down
9 changes: 3 additions & 6 deletions examples/dwarf_die_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
Expand Down
10 changes: 4 additions & 6 deletions examples/dwarf_location_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']


from elftools.common.py3compat import itervalues
from elftools.elf.elffile import ELFFile
Expand Down
9 changes: 3 additions & 6 deletions examples/dwarf_range_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import itervalues
from elftools.elf.elffile import ELFFile
Expand Down
9 changes: 3 additions & 6 deletions examples/elf_low_high_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
Expand Down
10 changes: 4 additions & 6 deletions examples/elf_relocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']


from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
Expand Down
9 changes: 3 additions & 6 deletions examples/elf_show_debug_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
Expand Down
9 changes: 3 additions & 6 deletions examples/elfclass_address_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.elf.elffile import ELFFile

Expand Down
9 changes: 3 additions & 6 deletions examples/examine_dwarf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
from __future__ import print_function
import sys

# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
try:
import elftools
except ImportError:
sys.path[0:0] = ['.', '..']
# If pyelftools is not installed, the example can also run from the root or
# examples/ dir of the source distribution.
sys.path[0:0] = ['.', '..']

from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
Expand Down

0 comments on commit cc1e557

Please sign in to comment.