]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43434: Clean up sqlite3.connect() after GH-25818 (GH-25823)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Sun, 2 May 2021 22:10:51 +0000 (00:10 +0200)
committerGitHub <noreply@github.com>
Sun, 2 May 2021 22:10:51 +0000 (23:10 +0100)
Modules/_sqlite/module.c

index 324994641b4a4a865be88fc8b56dcc5644ab85cd..a5e5525481f756fa48bd6af0ebe04d7192cd8b8a 100644 (file)
@@ -77,8 +77,6 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
     int uri = 0;
     double timeout = 5.0;
 
-    PyObject* result;
-
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|diOiOip", kwlist,
                                      &database, &timeout, &detect_types,
                                      &isolation_level, &check_same_thread,
@@ -91,12 +89,7 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
         factory = (PyObject*)pysqlite_ConnectionType;
     }
 
-    result = PyObject_Call(factory, args, kwargs);
-    if (result == NULL) {
-        return NULL;
-    }
-
-    return result;
+    return PyObject_Call(factory, args, kwargs);
 }
 
 PyDoc_STRVAR(module_connect_doc,