Browse Source

Fix unnecessary incref of Py_False.

Jelmer Vernooij 11 years ago
parent
commit
3cd646b2bf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dulwich/_diff_tree.c

+ 1 - 1
dulwich/_diff_tree.c

@@ -260,6 +260,7 @@ static PyObject *py_is_tree(PyObject *self, PyObject *args)
 
 	if (mode == Py_None) {
 		result = Py_False;
+		Py_INCREF(result);
 	} else {
 		lmode = PyInt_AsLong(mode);
 		if (lmode == -1 && PyErr_Occurred()) {
@@ -268,7 +269,6 @@ static PyObject *py_is_tree(PyObject *self, PyObject *args)
 		}
 		result = PyBool_FromLong(S_ISDIR((mode_t)lmode));
 	}
-	Py_INCREF(result);
 	Py_DECREF(mode);
 	return result;
 }