diff options
| author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-06-15 14:47:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-15 14:47:34 +0200 |
| commit | 10a5c806d4dec6c342dcc9888fbe4fa1fa9b7a1f (patch) | |
| tree | 8ed7c361bfa27d7b41bcab5a43c9ebc1957e7fd3 /Modules/_sqlite/microprotocols.c | |
| parent | 8ebd9447e9618240ee3b955888d114376f64117b (diff) | |
| download | cpython-git-10a5c806d4dec6c342dcc9888fbe4fa1fa9b7a1f.tar.gz | |
bpo-42064: Move sqlite3 types to global state (GH-26537)
* Move connection type to global state
* Move cursor type to global state
* Move prepare protocol type to global state
* Move row type to global state
* Move statement type to global state
* ADD_TYPE takes a pointer
* pysqlite_get_state is now static inline
Diffstat (limited to 'Modules/_sqlite/microprotocols.c')
| -rw-r--r-- | Modules/_sqlite/microprotocols.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c index e219a7239f..b2d6e7c427 100644 --- a/Modules/_sqlite/microprotocols.c +++ b/Modules/_sqlite/microprotocols.c @@ -58,8 +58,8 @@ pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast) PyObject* key; int rc; - if (proto == NULL) proto = (PyObject*)pysqlite_PrepareProtocolType; - + assert(type != NULL); + assert(proto != NULL); key = Py_BuildValue("(OO)", (PyObject*)type, proto); if (!key) { return -1; @@ -81,7 +81,7 @@ pysqlite_microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt) PyObject *adapter, *key, *adapted; /* we don't check for exact type conformance as specified in PEP 246 - because the pysqlite_PrepareProtocolType type is abstract and there is no + because the PrepareProtocolType type is abstract and there is no way to get a quotable object to be its instance */ /* look for an adapter in the registry */ |
