diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2020-11-04 19:31:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 19:31:51 (GMT) |
commit | 789359f47c2a744caa9a405131706099fd7ad6bd (patch) | |
tree | 946fd05f4c0489f766e6b144e763559cda0e95c1 /Modules/_sqlite/microprotocols.c | |
parent | 7184218e186811e75be663be78e57d5302bf8af6 (diff) | |
download | cpython-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.c | 8 |
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; } |