Skip to content

Commit 67d9077

Browse files
committed
fix symtab check
1 parent 6ec98dc commit 67d9077

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/venv_site_packages_libs/shared_lib_loading_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from elftools.elf.elffile import ELFFile
66
from macholib import mach_o
77
from macholib.MachO import MachO
8+
from macholib.symtab import SymbolTable
89

910

1011
class SharedLibLoadingTest(unittest.TestCase):
@@ -108,10 +109,10 @@ def _assert_macho_linking(self, path):
108109
self.assertIn("@rpath/libincrement.dylib", loaded_dylibs)
109110

110111
# Check that the 'increment' symbol is undefined.
111-
self.assertIsNotNone(macho.symtab)
112+
symtab = SymbolTable(macho)
112113
undefined_symbols = [
113114
s.n_name.decode()
114-
for s in macho.symtab.nlists
115+
for s in symtab.nlists
115116
if s.n_type & 0x01 and s.n_sect == 0 # N_EXT and NO_SECT
116117
]
117118
self.assertIn("_increment", undefined_symbols)

0 commit comments

Comments
 (0)