closes bpo-32460: ensure all non-static globals have initializers (#5061)
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c
index 2261b80..3d01872 100644
--- a/Modules/_sqlite/microprotocols.c
+++ b/Modules/_sqlite/microprotocols.c
@@ -33,7 +33,7 @@
/** the adapters registry **/
-PyObject *psyco_adapters;
+static PyObject *psyco_adapters = NULL;
/* pysqlite_microprotocols_init - initialize the adapters dictionary */
diff --git a/Modules/_sqlite/microprotocols.h b/Modules/_sqlite/microprotocols.h
index 6941716..99ff6f6 100644
--- a/Modules/_sqlite/microprotocols.h
+++ b/Modules/_sqlite/microprotocols.h
@@ -28,10 +28,6 @@
#include <Python.h>
-/** adapters registry **/
-
-extern PyObject *psyco_adapters;
-
/** the names of the three mandatory methods **/
#define MICROPROTOCOLS_GETQUOTED_NAME "getquoted"
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 9066c32..879c666 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -35,13 +35,20 @@
/* static objects at module-level */
-PyObject* pysqlite_Error, *pysqlite_Warning, *pysqlite_InterfaceError, *pysqlite_DatabaseError,
- *pysqlite_InternalError, *pysqlite_OperationalError, *pysqlite_ProgrammingError,
- *pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError;
+PyObject *pysqlite_Error = NULL;
+PyObject *pysqlite_Warning = NULL;
+PyObject *pysqlite_InterfaceError = NULL;
+PyObject *pysqlite_DatabaseError = NULL;
+PyObject *pysqlite_InternalError = NULL;
+PyObject *pysqlite_OperationalError = NULL;
+PyObject *pysqlite_ProgrammingError = NULL;
+PyObject *pysqlite_IntegrityError = NULL;
+PyObject *pysqlite_DataError = NULL;
+PyObject *pysqlite_NotSupportedError = NULL;
-PyObject* converters;
-int _enable_callback_tracebacks;
-int pysqlite_BaseTypeAdapted;
+PyObject* converters = NULL;
+int _enable_callback_tracebacks = 0;
+int pysqlite_BaseTypeAdapted = 0;
static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
kwargs)
@@ -461,10 +468,6 @@
/* initialize the default converters */
converters_init(dict);
- _enable_callback_tracebacks = 0;
-
- pysqlite_BaseTypeAdapted = 0;
-
error:
if (PyErr_Occurred())
{