gh-106320: Remove private _PyImport C API functions (#106383)

* Remove private _PyImport C API functions: move them to the internal
  C API (pycore_import.h).
* No longer export most of these private functions.
* _testcapi avoids private _PyImport_GetModuleAttrString().
This commit is contained in:
Victor Stinner 2023-07-04 01:02:07 +02:00 committed by GitHub
parent f6d2bb18ab
commit 2e92edbf6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 22 deletions

View file

@ -33,6 +33,7 @@
#include "blob.h"
#include "prepare_protocol.h"
#include "util.h"
#include "pycore_import.h" // _PyImport_GetModuleAttrString()
#include "pycore_weakref.h" // _PyWeakref_IS_DEAD()
#include <stdbool.h>

View file

@ -21,6 +21,10 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "connection.h"
#include "statement.h"
#include "cursor.h"
@ -29,6 +33,8 @@
#include "row.h"
#include "blob.h"
#include "pycore_import.h" // _PyImport_GetModuleAttrString()
#if SQLITE_VERSION_NUMBER < 3015002
#error "SQLite 3.15.2 or higher required"
#endif