10000 [2.7] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8… · python/cpython@dc39a59 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc39a59

Browse files
authored
[2.7] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8217)
(cherry picked from commit 7762e4d) Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent 695ecd9 commit dc39a59

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

Modules/_sqlite/connection.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
675675
Py_DECREF(py_retval);
676676
}
677677
if (!ok) {
678-
if (_enable_callback_tracebacks) {
678+
if (_pysqlite_enable_callback_tracebacks) {
679679
PyErr_Print();
680680
} else {
681681
PyErr_Clear();
@@ -711,7 +711,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
711711

712712
if (PyErr_Occurred()) {
713713
*aggregate_instance = 0;
714-
if (_enable_callback_tracebacks) {
714+
if (_pysqlite_enable_callback_tracebacks) {
715715
PyErr_Print();
716716
} else {
717717
PyErr_Clear();
@@ -735,7 +735,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
735735
Py_DECREF(args);
736736

737737
if (!function_result) {
738-
if (_enable_callback_tracebacks) {
738+
if (_pysqlite_enable_callback_tracebacks) {
739739
PyErr_Print();
740740
} else {
741741
PyErr_Clear();
@@ -781,7 +781,7 @@ void _pysqlite_final_callback(sqlite3_context* context)
781781
Py_DECREF(function_result);
782782
}
783783
if (!ok) {
784-
if (_enable_callback_tracebacks) {
784+
if (_pysqlite_enable_callback_tracebacks) {
785785
PyErr_Print();
786786
} else {
787787
PyErr_Clear();
@@ -936,7 +936,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
936936
ret = PyObject_CallFunction((PyObject*)user_arg, "issss", action, arg1, arg2, dbname, access_attempt_source);
937937

938938
if (!ret) {
939-
if (_enable_callback_tracebacks) {
939+
if (_pysqlite_enable_callback_tracebacks) {
940940
PyErr_Print();
941941
} else {
942942
PyErr_Clear();
@@ -972,7 +972,7 @@ static int _progress_handler(void* user_arg)
972972
ret = PyObject_CallFunction((PyObject*)user_arg, "");
973973

974974
if (!ret) {
975-
if (_enable_callback_tracebacks) {
975+
if (_pysqlite_enable_callback_tracebacks) {
976976
PyErr_Print();
977977
} else {
978978
PyErr_Clear();

Modules/_sqlite/cursor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ PyObject* _pysqlite_get_converter(PyObject* key)
147147
return NULL;
148148
}
149149

150-
retval = PyDict_GetItem(converters, upcase_key);
150+
retval = PyDict_GetItem(_pysqlite_converters, upcase_key);
151151
Py_DECREF(upcase_key);
152152

153153
return retval;
@@ -655,7 +655,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
655655
} else {
656656
if (PyErr_Occurred()) {
657657
/* there was an error that occurred in a user-defined callback */
658-
if (_enable_callback_tracebacks) {
658+
if (_pysqlite_enable_callback_tracebacks) {
659659
PyErr_Print();
660660
} else {
661661
PyErr_Clear();

Modules/_sqlite/module.c

Lines changed: 8 additions & 8 deletions
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, *pysqlite_OptimizedUnicode;
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*
@@ -190,7 +190,7 @@ static PyObject* module_register_converter(PyObject* self, PyObject* args)
190190
goto error;
191191
}
192192

193-
if (PyDict_SetItem(converters, name, callable) != 0) {
193+
if (PyDict_SetItem(_pysqlite_converters, name, callable) != 0) {
194194
goto error;
195195
}
196196

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

209209
static PyObject* enable_callback_tracebacks(PyObject* self, PyObject* args)
210210
{
211-
if (!PyArg_ParseTuple(args, "i", &_enable_callback_tracebacks)) {
211+
if (!PyArg_ParseTuple(args, "i", &_pysqlite_enable_callback_tracebacks)) {
212212
return NULL;
213213
}
214214

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

224224
static void converters_init(PyObject* dict)
225225
{
226-
converters = PyDict_New();
227-
if (!converters) {
226+
_pysqlite_converters = PyDict_New();
227+
if (!_pysqlite_converters) {
228228
return;
229229
}
230230

231-
PyDict_SetItemString(dict, "converters", converters);
231+
PyDict_SetItemString(dict, "converters", _pysqlite_converters);
232232
}
233233

234234
static PyMethodDef module_methods[] = {
@@ -428,7 +428,7 @@ PyMODINIT_FUNC init_sqlite3(void)
428428
/* initialize the default converters */
429429
converters_init(dict);
430430

431-
_enable_callback_tracebacks = 0;
431+
_pysqlite_enable_callback_tracebacks = 0;
432432

433433
pysqlite_BaseTypeAdapted = 0;
434434

Modules/_sqlite/module.h

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

49-
extern int _enable_callback_tracebacks;
49+
extern int _pysqlite_enable_callback_tracebacks;
5050
extern int pysqlite_BaseTypeAdapted;
5151

5252
#define PARSE_DECLTYPES 1

0 commit comments

Comments
 (0)
0