Skip to content

Commit 96e2652

Browse files
committed
Work around Cython 3.1.2 non-static internal function bug
Cython recently added __pyx_CommonTypesMetaclass_get_module() but neglected to make it static; cf cython/cython#6957. Remove it from the lists of defined symbols to be checked for collisions. Also ensure that we only strip one leading underscore on macOS, so that this function's name is as expected.
1 parent 30f4d4b commit 96e2652

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,14 @@ def run_nm_defined_symbols(objfile):
9999
if symtype not in "UFNWw":
100100
if IS_DARWIN:
101101
# On macOS, all symbols have a leading underscore
102-
symbols.add(sym.lstrip('_'))
102+
symbols.add(sym[1:] if sym.startswith("_") else sym)
103103
else:
104104
# Ignore symbols such as _edata (present in all shared objects)
105105
if sym[0] not in "_$.@": symbols.add(sym)
106106

107+
# Work around Cython 3.1.2 bug whereby this function is not static
108+
symbols.discard("__pyx_CommonTypesMetaclass_get_module")
109+
107110
return symbols
108111

109112

0 commit comments

Comments
 (0)