Skip to content

Commit

Permalink
try --extern-only
Browse files Browse the repository at this point in the history
  • Loading branch information
tschorr committed Sep 19, 2022
1 parent e3354d8 commit 04a1c14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/check_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
cfgs += ['--cfg', 'py_sys_config="{}_{}"'.format(name, sysconfig.get_config_var(name))]

subprocess.call(cargo_cmd + ['--'] + cfgs)
output = subprocess.check_output(['nm', '-C', '-u', '../target/debug/libpython{}_sys.rlib'.format(3 if sys.version_info.major == 3 else 27)])
output = subprocess.check_output(['nm', '-C', '-g', '../target/debug/libpython{}_sys.rlib'.format(3 if sys.version_info.major == 3 else 27)])
lines = output.decode('ascii').split('\n')
foreign_symbols = set()

for line in lines:
if ' U ' in line:
symb = line.split(' U ')[-1]
foreign_symbols.add(symb)
parts = line.split(' ')
if len(parts) > 1:
foreign_symbols.add(parts[-1])

print(lines[:25])
print(len(foreign_symbols))
Expand Down

0 comments on commit 04a1c14

Please sign in to comment.