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

Skip to content

Commit 7762e4d

Browse files
authored
prefix internal sqlite symbols with _pysqlite_ (GH-8215)
1 parent d6d4432 commit 7762e4d

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Modules/_sqlite/connection.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void _pysqlite_func_callback(sqlite3_context* context, int argc, sqlite3_value**
617617
Py_DECREF(py_retval);
618618
}
619619
if (!ok) {
620-
if (_enable_callback_tracebacks) {
620+
if (_pysqlite_enable_callback_tracebacks) {
621621
PyErr_Print();
622622
} else {
623623
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();
@@ -723,7 +723,7 @@ void _pysqlite_final_callback(sqlite3_context* context)
723723
Py_DECREF(function_result);
724724
}
725725
if (!ok) {
726-
if (_enable_callback_tracebacks) {
726+
if (_pysqlite_enable_callback_tracebacks) {
727727
PyErr_Print();
728728
} else {
729729
PyErr_Clear();
@@ -907,7 +907,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
907907
ret = PyObject_CallFunction((PyObject*)user_arg, "issss", action, arg1, arg2, dbname, access_attempt_source);
908908

909909
if (ret == NULL) {
910-
if (_enable_callback_tracebacks)
910+
if (_pysqlite_enable_callback_tracebacks)
911911
PyErr_Print();
912912
else
913913
PyErr_Clear();
@@ -918,7 +918,7 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
918918
if (PyLong_Check(ret)) {
919919
rc = _PyLong_AsInt(ret);
920920
if (rc == -1 && PyErr_Occurred()) {
921-
if (_enable_callback_tracebacks)
921+
if (_pysqlite_enable_callback_tracebacks)
922922
PyErr_Print();
923923
else
924924
PyErr_Clear();
@@ -945,7 +945,7 @@ static int _progress_handler(void* user_arg)
945945
ret = _PyObject_CallNoArg((PyObject*)user_arg);
946946

947947
if (!ret) {
948-
if (_enable_callback_tracebacks) {
948+
if (_pysqlite_enable_callback_tracebacks) {
949949
PyErr_Print();
950950
} else {
951951
PyErr_Clear();
@@ -980,7 +980,7 @@ static void _trace_callback(void* user_arg, const char* statement_string)
980980
if (ret) {
981981
Py_DECREF(ret);
982982
} else {
983-
if (_enable_callback_tracebacks) {
983+
if (_pysqlite_enable_callback_tracebacks) {
984984
PyErr_Print();
985985
} else {
986986
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;
@@ -539,7 +539,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
539539
if (rc != SQLITE_DONE && rc != SQLITE_ROW) {
540540
if (PyErr_Occurred()) {
541541
/* there was an error that occurred in a user-defined callback */
542-
if (_enable_callback_tracebacks) {
542+
if (_pysqlite_enable_callback_tracebacks) {
543543
PyErr_Print();
544544
} else {
545545
PyErr_Clear();

Modules/_sqlite/module.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ PyObject *pysqlite_IntegrityError = NULL;
4646
PyObject *pysqlite_DataError = NULL;
4747
PyObject *pysqlite_NotSupportedError = NULL;
4848

49-
PyObject* converters = NULL;
50-
int _enable_callback_tracebacks = 0;
49+
PyObject* _pysqlite_converters = NULL;
50+
int _pysqlite_enable_callback_tracebacks = 0;
5151
int pysqlite_BaseTypeAdapted = 0;
5252

5353
static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
@@ -204,7 +204,7 @@ static PyObject* module_register_converter(PyObject* self, PyObject* args)
204204
goto error;
205205
}
206206

207-
if (PyDict_SetItem(converters, name, callable) != 0) {
207+
if (PyDict_SetItem(_pysqlite_converters, name, callable) != 0) {
208208
goto error;
209209
}
210210

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

223223
static PyObject* enable_callback_tracebacks(PyObject* self, PyObject* args)
224224
{
225-
if (!PyArg_ParseTuple(args, "i", &_enable_callback_tracebacks)) {
225+
if (!PyArg_ParseTuple(args, "i", &_pysqlite_enable_callback_tracebacks)) {
226226
return NULL;
227227
}
228228

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

237237
static void converters_init(PyObject* dict)
238238
{
239-
converters = PyDict_New();
240-
if (!converters) {
239+
_pysqlite_converters = PyDict_New();
240+
if (!_pysqlite_converters) {
241241
return;
242242
}
243243

244-
PyDict_SetItemString(dict, "converters", converters);
244+
PyDict_SetItemString(dict, "converters", _pysqlite_converters);
245245
}
246246

247247
static PyMethodDef module_methods[] = {

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