From 659d47fb1bc19d5b287a7a98f7a7559988481d11 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Tue, 15 Dec 2020 16:50:28 +0000 Subject: [PATCH] Update stable ABI script for MacOS and update list of exported symbols --- Doc/data/stable_abi.dat | 1 + Tools/scripts/stable_abi.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 28cb50b12301ba..c2c9c6e11e4ce1 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -743,6 +743,7 @@ Py_FileSystemDefaultEncodeErrors Py_FileSystemDefaultEncoding Py_Finalize Py_FinalizeEx +Py_FrozenMain Py_GenericAlias Py_GenericAliasType Py_GetBuildInfo diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py index b3a46f985e0a2d..47547a97bfd318 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -31,6 +31,7 @@ "ucnhash.h", } +MACOS = (sys.platform == "darwin") def get_exported_symbols(library, dynamic=False): # Only look at dynamic symbols @@ -57,7 +58,10 @@ def get_exported_symbols(library, dynamic=False): continue symbol = parts[-1] - yield symbol + if MACOS and symbol.startswith("_"): + yield symbol[1:] + else: + yield symbol def check_library(stable_abi_file, library, abi_funcs, dynamic=False):