Commits

Georg Brandl committed 8c1bf79

Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
(backport from rev. 43014)

Comments (0)

Files changed (1)

 {
 	PyObject *res;
 
-	if (v == NULL)
+	if (v == NULL) {
 		res = PyString_FromString("<NULL>");
-	if (PyUnicode_CheckExact(v)) {
+	} else if (PyUnicode_CheckExact(v)) {
 		Py_INCREF(v);
 		return v;
 	}