Skip to content

Commit

Permalink
_audit: relax PyInit check
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed Sep 30, 2024
1 parent db28d19 commit 18d1524
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions abi3audit/_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ def audit(so: SharedObject, assume_minimum_abi3: PyVersion = PyVersion(3, 2)) ->
if maybe_abi3.added > baseline:
future_abi3_objects.add(maybe_abi3)
elif sym.name.startswith(("Py", "_Py")):
# exclude the shared object's entry point from reports.
# This is always PyInit_$EXTNAME, e.g. `PyInit_foo` for foo.abi3.so.
if sym.name == "PyInit_" + so.path.with_suffix("").stem:
# Exclude module initialization symbols. Technically
# this should always be `PyInit_{filename}` but there can
# be multiple if a shared object contains multiple extensions;
# see https://github.com/pypa/abi3audit/issues/111.
if sym.name.startswith("PyInit_"):
continue
# local symbols are fine, since they are inlined functions
# Local symbols are fine, since they are inlined functions
# from the CPython limited API.
if sym not in _ALLOWED_SYMBOLS and sym.visibility != "local":
non_abi3_symbols.add(sym)
Expand Down

0 comments on commit 18d1524

Please sign in to comment.