aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_sqlite/module.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2025-01-30 12:17:29 +0100
committerGitHub <noreply@github.com>2025-01-30 11:17:29 +0000
commit3bebe46d3413195ee18c5c9ada83a35d4fd1d0e7 (patch)
tree8918bff5c9b4782e75a923014886d9b4b44bfed2 /Modules/_sqlite/module.c
parentf927204f64b3f8dbecec784e05bc8e25d2a78b2e (diff)
downloadcpython-3bebe46d3413195ee18c5c9ada83a35d4fd1d0e7.tar.gz
cpython-3bebe46d3413195ee18c5c9ada83a35d4fd1d0e7.zip
gh-128911: Add PyImport_ImportModuleAttr() function (#128912)
Add PyImport_ImportModuleAttr() and PyImport_ImportModuleAttrString() functions. * Add unit tests. * Replace _PyImport_GetModuleAttr() with PyImport_ImportModuleAttr(). * Replace _PyImport_GetModuleAttrString() with PyImport_ImportModuleAttrString(). * Remove "pycore_import.h" includes, no longer needed.
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r--Modules/_sqlite/module.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 698e81d9b89..73d55fb44e2 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -33,8 +33,6 @@
#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
@@ -234,7 +232,7 @@ static int
load_functools_lru_cache(PyObject *module)
{
pysqlite_state *state = pysqlite_get_state(module);
- state->lru_cache = _PyImport_GetModuleAttrString("functools", "lru_cache");
+ state->lru_cache = PyImport_ImportModuleAttrString("functools", "lru_cache");
if (state->lru_cache == NULL) {
return -1;
}