[Python-checkins] [3.6] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8218)
Benjamin Peterson
webhook-mailer at python.org
Tue Jul 10 01:36:45 EDT 2018
https://github.com/python/cpython/commit/a2aabad3b9fa77cfcc532c7a5d7ce3ae39705b47
commit: a2aabad3b9fa77cfcc532c7a5d7ce3ae39705b47
branch: 3.6
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2018-07-09T22:36:41-07:00
summary:
[3.6] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8218)
(cherry picked from commit 7762e4d3872818272800dfbd8e1d8e3a689eb8f2)
Co-authored-by: Benjamin Peterson <benjamin at python.org>
files:
M Modules/_sqlite/connection.c
M Modules/_sqlite/cursor.c
M Modules/_sqlite/module.c
M Modules/_sqlite/module.h
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 32cd306b3721..f503288336d0 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -613,7 +613,7 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
Py_DECREF(py_retval);
}
if (!ok) {
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
@@ -649,7 +649,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
if (PyErr_Occurred()) {
*aggregate_instance = 0;
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
@@ -673,7 +673,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
Py_DECREF(args);
if (!function_result) {
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
@@ -727,7 +727,7 @@ void _pysqlite_final_callback(sqlite3_context* context)
Py_DECREF(function_result);
}
if (!ok) {
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
@@ -894,7 +894,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
ret = PyObject_CallFunction((PyObject*)user_arg, "issss", action, arg1, arg2, dbname, access_attempt_source);
if (ret == NULL) {
- if (_enable_callback_tracebacks)
+ if (_pysqlite_enable_callback_tracebacks)
PyErr_Print();
else
PyErr_Clear();
@@ -905,7 +905,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
if (PyLong_Check(ret)) {
rc = _PyLong_AsInt(ret);
if (rc == -1 && PyErr_Occurred()) {
- if (_enable_callback_tracebacks)
+ if (_pysqlite_enable_callback_tracebacks)
PyErr_Print();
else
PyErr_Clear();
@@ -936,7 +936,7 @@ static int _progress_handler(void* user_arg)
ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
if (!ret) {
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
@@ -975,7 +975,7 @@ static void _trace_callback(void* user_arg, const char* statement_string)
if (ret) {
Py_DECREF(ret);
} else {
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 82373409471a..098d5a3575d1 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -109,7 +109,7 @@ PyObject* _pysqlite_get_converter(PyObject* key)
return NULL;
}
- retval = PyDict_GetItem(converters, upcase_key);
+ retval = PyDict_GetItem(_pysqlite_converters, upcase_key);
Py_DECREF(upcase_key);
return retval;
@@ -564,7 +564,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
} else {
if (PyErr_Occurred()) {
/* there was an error that occurred in a user-defined callback */
- if (_enable_callback_tracebacks) {
+ if (_pysqlite_enable_callback_tracebacks) {
PyErr_Print();
} else {
PyErr_Clear();
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index cc45331ab55d..7af22846736b 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -39,8 +39,8 @@ PyObject* pysqlite_Error, *pysqlite_Warning, *pysqlite_InterfaceError, *pysqlite
*pysqlite_InternalError, *pysqlite_OperationalError, *pysqlite_ProgrammingError,
*pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError;
-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*
@@ -197,7 +197,7 @@ static PyObject* module_register_converter(PyObject* self, PyObject* args)
goto error;
}
- if (PyDict_SetItem(converters, name, callable) != 0) {
+ if (PyDict_SetItem(_pysqlite_converters, name, callable) != 0) {
goto error;
}
@@ -215,7 +215,7 @@ Registers a converter with pysqlite. Non-standard.");
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;
}
@@ -229,12 +229,12 @@ Enable or disable callback functions throwing errors to stderr.");
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[] = {
@@ -448,7 +448,7 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
/* initialize the default converters */
converters_init(dict);
- _enable_callback_tracebacks = 0;
+ _pysqlite_enable_callback_tracebacks = 0;
pysqlite_BaseTypeAdapted = 0;
diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h
index d3df9123bfaa..6f90934b325d 100644
--- a/Modules/_sqlite/module.h
+++ b/Modules/_sqlite/module.h
@@ -42,9 +42,9 @@ extern PyObject* pysqlite_NotSupportedError;
* functions, that convert the SQL value to the appropriate Python value.
* The key is uppercase.
*/
-extern PyObject* converters;
+extern PyObject* _pysqlite_converters;
-extern int _enable_callback_tracebacks;
+extern int _pysqlite_enable_callback_tracebacks;
extern int pysqlite_BaseTypeAdapted;
#define PARSE_DECLTYPES 1
More information about the Python-checkins
mailing list