8000 [3.6] prefix internal sqlite symbols with _pysqlite_ (GH-8215). · python/cpython@750de0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 750de0b

Browse files
committed
[3.6] prefix internal sqlite symbols with _pysqlite_ (GH-8215).
(cherry picked from commit 7762e4d) Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent 9a390b6 commit 750de0b

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

Modules/_sqlite/connection.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
613613
Py_DECREF(py_retval);
614614
}
615615
if (!ok) {
616-
if (_enable_callback_tracebacks) {
616+
if (_pysqlite_enable_callback_tracebacks) {
617617
PyErr_Print();
618618
} else {
619619
PyErr_Clear();
@@ -649,7 +649,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
649649

650650
if (PyErr_Occurred()) {
651651
*aggregate_instance = 0;
652-
if (_enable_callback_tracebacks) {
652+
if (_pysqlite_enable_callback_tracebacks) {
653653
PyErr_Print();
654654
} else {
655655
PyErr_Clear();
@@ -673,7 +673,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
673673
Py_DECREF(args);
674674

675675
if (!function_result) {
676-
if (_enable_callback_tracebacks) {
676+
if (_pysqlite_enable_callback_tracebacks) {
677677
PyErr_Print();
678678
} else {
679679
PyErr_Clear();
@@ -727,7 +727,7 @@ void _pysqlite_final_callback(sqlite3_context* context)
727727
Py_DECREF(function_result);
728728
}
729729
if (!ok) {
730-
if (_enable_callback_tracebacks) {
730+
if (_pysqlite_enable_callback_tracebacks) {
731731
PyErr_Print();
732732
} else {
733733
PyErr_Clear();
@@ -894,7 +894,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
894894
ret = PyObject_CallFunction((PyObject*)user_arg, "issss", action, arg1, arg2, dbname, access_attempt_source);
895895

896896
if (ret == NULL) {
897-
if (_enable_callback_tracebacks)
897+
if (_pysqlite_enable_callback_tracebacks)
898898
PyErr_Print();
899899
else
900900
PyErr_Clear();
@@ -905,7 +905,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
905905
if (PyLong_Check(ret)) {
906906
rc = _PyLong_AsInt(ret);
907907
if (rc == -1 && PyErr_Occurred()) {
908-
if (_enable_callback_tracebacks)
908+
if (_pysqlite_enable_callback_tracebacks)
909909
PyErr_Print();
910910
else
911911
PyErr_Clear();
@@ -936,7 +936,7 @@ static int _progress_handler(void* user_arg)
936936
ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
937937

938938
if (!ret) {
939-
if (_enable_callback_tracebacks) {
939+
if (_pysqlite_enable_callback_tracebacks) {
940940
PyErr_Print();
941941
} else {
942942
PyErr_Clear();
@@ -975,7 +975,7 @@ static void _trace_callback(void* user_arg, const char* statement_string)
975975
if (ret) {
976976
Py_DECREF(ret);
977977
} else {
978-
if (_enable_callback_tracebacks) {
978+
if (_pysqlite_enable_callback_tracebacks) {
979979
PyErr_Print();
980980
} else {
981981
PyErr_Clear();

Modules/_sqlite/cursor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ PyObject* _pysqlite_get_converter(PyObject* key)
109109
return NULL;
110110
}
111111

112-
retval = PyDict_GetItem(converters, upcase_key);
112+
retval = PyDict_GetItem(_pysqlite_converters, upcase_key);
113113
Py_DECREF(upcase_key);
114114

115115
return retval;
@@ -564,7 +564,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
564564
} else {
565565
if (PyErr_Occurred()) {
566566
/* there was an error that occurred in a user-defined callback */
567-
if (_enable_callback_tracebacks) {
567+
if (_pysqlite_enable_callback_tracebacks) {
568568
PyErr_Print();
569569
} else {
570570
PyErr_Clear();

Modules/_sqlite/module.c

Lines changed: 8 additions & 8 deletions
6D4E
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ PyObject* pysqlite_Error, *pysqlite_Warning, *pysqlite_InterfaceError, *pysqlite
3939
*pysqlite_InternalError, *pysqlite_OperationalError, *pysqlite_ProgrammingError,
4040
*pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError;
4141

42-
PyObject* converters;
43-
int _enable_callback_tracebacks;
42+
PyObject* _pysqlite_converters;
43+
int _pysqlite_enable_callback_tracebacks;
4444
int pysqlite_BaseTypeAdapted;
4545

4646
static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
@@ -197,7 +197,7 @@ static PyObject* module_register_converter(PyObject* self, PyObject* args)
197197
goto error;
198198
}
199199

200-
if (PyDict_SetItem(converters, name, callable) != 0) {
200+
if (PyDict_SetItem(_pysqlite_converters, name, callable) != 0) {
201201
goto error;
202202
}
203203

@@ -215,7 +215,7 @@ Registers a converter with pysqlite. Non-standard.");
215215

216216
static PyObject* enable_callback_tracebacks(PyObject* self, PyObject* args)
217217
{
218-
if (!PyArg_ParseTuple(args, "i", &_enable_callback_tracebacks)) {
218+
if (!PyArg_ParseTuple(args, "i", &_pysqlite_enable_callback_tracebacks)) {
219219
return NULL;
220220
}
221221

@@ -229,12 +229,12 @@ Enable or disable callback functions throwing errors to stderr.");
229229

230230
static void converters_init(PyObject* dict)
231231
{
232-
converters = PyDict_New();
233-
if (!converters) {
232+
_pysqlite_converters = PyDict_New();
233+
if (!_pysqlite_converters) {
234234
return;
235235
}
236236

237-
PyDict_SetItemString(dict, "converters", converters);
237+
PyDict_SetItemString(dict, "converters", _pysqlite_converters);
238238
}
239239

240240
static PyMethodDef module_methods[] = {
@@ -448,7 +448,7 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
448448
/* initialize the default converters */
449449
converters_init(dict);
450450

451-
_enable_callback_tracebacks = 0;
451+
_pysqlite_enable_callback_tracebacks = 0;
452452

453453
pysqlite_BaseTypeAdapted = 0;
454454

Modules/_sqlite/module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ extern PyObject* pysqlite_NotSupportedError;
4242
* functions, that convert the SQL value to the appropriate Python value.
4343
* The key is uppercase.
4444
*/
45-
extern PyObject* converters;
45+
extern PyObject* _pysqlite_converters;
4646

47-
extern int _enable_callback_tracebacks;
47+
extern int _pysqlite_enable_callback_tracebacks;
4848
extern int pysqlite_BaseTypeAdapted;
4949

5050
#define PARSE_DECLTYPES 1

0 commit comments

Comments
 (0)
0