Bob Ippolito (@etrepum) on Haskell, Python, Erlang, JavaScript, etc.
«

macholib does symbols now

»

I wrote some code last night that adds some rudimentary Mach-O symbol table support to macholib. I did this primarily because py2exe introspects dll and pyd files to see if they reference PyImport_ImportModule so that it can potentially display a warning message since the extension will be able to dynamically add dependencies to the application in a way that is undetectable without actually running the code.

>>> import macholib
>>> s = macholib.SymbolTable(macholib.MachO('pygame/display.so'))
>>> for (nlist, name) in s.undefsyms:
...   if name == '_PyImport_ImportModule':
...     print name
...     break
...
_PyImport_ImportModule