[2.7] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8217)
(cherry picked from commit 7762e4d3872818272800dfbd8e1d8e3a689eb8f2)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 33611d9..fa45edf 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -39,8 +39,8 @@
*pysqlite_InternalError, *pysqlite_OperationalError, *pysqlite_ProgrammingError,
*pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError, *pysqlite_OptimizedUnicode;
-PyObject* converters;
-int _enable_callback_tracebacks;
+PyObject* _pysqlite_converters;
+int _pysqlite_enable_callback_tracebacks;
int pysqlite_BaseTypeAdapted;
static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
@@ -190,7 +190,7 @@
goto error;
}
- if (PyDict_SetItem(converters, name, callable) != 0) {
+ if (PyDict_SetItem(_pysqlite_converters, name, callable) != 0) {
goto error;
}
@@ -208,7 +208,7 @@
static PyObject* enable_callback_tracebacks(PyObject* self, PyObject* args)
{
- if (!PyArg_ParseTuple(args, "i", &_enable_callback_tracebacks)) {
+ if (!PyArg_ParseTuple(args, "i", &_pysqlite_enable_callback_tracebacks)) {
return NULL;
}
@@ -223,12 +223,12 @@
static void converters_init(PyObject* dict)
{
- converters = PyDict_New();
- if (!converters) {
+ _pysqlite_converters = PyDict_New();
+ if (!_pysqlite_converters) {
return;
}
- PyDict_SetItemString(dict, "converters", converters);
+ PyDict_SetItemString(dict, "converters", _pysqlite_converters);
}
static PyMethodDef module_methods[] = {
@@ -428,7 +428,7 @@
/* initialize the default converters */
converters_init(dict);
- _enable_callback_tracebacks = 0;
+ _pysqlite_enable_callback_tracebacks = 0;
pysqlite_BaseTypeAdapted = 0;