summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/microprotocols.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2020-11-04 19:31:51 (GMT)
committerGitHub <noreply@github.com>2020-11-04 19:31:51 (GMT)
commit789359f47c2a744caa9a405131706099fd7ad6bd (patch)
tree946fd05f4c0489f766e6b144e763559cda0e95c1 /Modules/_sqlite/microprotocols.c
parent7184218e186811e75be663be78e57d5302bf8af6 (diff)
downloadcpython-789359f47c2a744caa9a405131706099fd7ad6bd.zip
cpython-789359f47c2a744caa9a405131706099fd7ad6bd.tar.gz
cpython-789359f47c2a744caa9a405131706099fd7ad6bd.tar.bz2
bpo-1635741: _sqlite3 uses PyModule_AddObjectRef() (GH-23148)
Diffstat (limited to 'Modules/_sqlite/microprotocols.c')
-rw-r--r--Modules/_sqlite/microprotocols.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c
index cf1fefd..41f0867 100644
--- a/Modules/_sqlite/microprotocols.c
+++ b/Modules/_sqlite/microprotocols.c
@@ -43,12 +43,10 @@ pysqlite_microprotocols_init(PyObject *module)
return -1;
}
- if (PyModule_AddObject(module, "adapters", psyco_adapters) < 0) {
- Py_DECREF(psyco_adapters);
- return -1;
- }
+ int res = PyModule_AddObjectRef(module, "adapters", psyco_adapters);
+ Py_DECREF(psyco_adapters);
- return 0;
+ return res;
}