]> git.neil.brown.name Git - edlib.git/commitdiff
python: silence a warning
authorNeilBrown <neil@brown.name>
Tue, 25 Apr 2023 00:18:42 +0000 (10:18 +1000)
committerNeilBrown <neil@brown.name>
Tue, 25 Apr 2023 00:18:42 +0000 (10:18 +1000)
smatch doesn't know 'a' cannot be NULL, so tell it.

Signed-off-by: NeilBrown <neil@brown.name>
lang-python.c

index 57d1e84087150b03144cb5673163796387cf5d90..2b0da75632a72d5d9feb535811d9407eb53365c1 100644 (file)
@@ -52,7 +52,7 @@ int PyType_HasFeature(PyTypeObject *type, unsigned long feature);
 #define Py_XDECREF(op) (0)
 #undef Py_IS_TYPE
 #define Py_IS_TYPE(ob, type) (ob == (void*)type)
-#else
+#else /* CHECKER */
 #include <Python.h>
 #endif
 struct Mark;
@@ -2557,7 +2557,7 @@ static bool get_cmd_info(struct cmd_info *ci safe, PyObject *args safe, PyObject
        }
        for (i = 1; i < argc; i++) {
                a = PyTuple_GetItem(args, i);
-               if (a == Py_None)
+               if (!a || a == Py_None)
                        /* quietly ignore */;
                else if (PyObject_TypeCheck(a, &PaneType)) {
                        if ((void*)ci->home == NULL)