[issue11110] Py_DECREF->Py_XDECREF in Module/_sqlite/module.c

Alexander Belopolsky report at bugs.python.org
Fri Feb 4 03:21:37 CET 2011


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

It may be clearer and match Python coding style better to fix it as follows:


Index: Modules/_sqlite/module.c
===================================================================
--- Modules/_sqlite/module.c	(revision 88320)
+++ Modules/_sqlite/module.c	(working copy)
@@ -321,14 +321,16 @@
 
     module = PyModule_Create(&_sqlite3module);
 
-    if (!module ||
-        (pysqlite_row_setup_types() < 0) ||
-        (pysqlite_cursor_setup_types() < 0) ||
-        (pysqlite_connection_setup_types() < 0) ||
-        (pysqlite_cache_setup_types() < 0) ||
-        (pysqlite_statement_setup_types() < 0) ||
-        (pysqlite_prepare_protocol_setup_types() < 0)
-       ) {
+    if (module == NULL)
+        return NULL;
+
+    if (pysqlite_row_setup_types() < 0 ||
+        pysqlite_cursor_setup_types() < 0 ||
+        pysqlite_connection_setup_types() < 0 ||
+        pysqlite_cache_setup_types() < 0 ||
+        pysqlite_statement_setup_types() < 0 ||
+        pysqlite_prepare_protocol_setup_types() < 0)
+    {
         Py_DECREF(module);
         return NULL;
     }

----------
nosy: +belopolsky

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11110>
_______________________________________


More information about the Python-bugs-list mailing list