statfs: simplify handling of return value
Py_BuildValue() can translate NULL pointer to None.
--- a/mercurial/osutil.c Sat Mar 25 18:22:27 2017 +0900
+++ b/mercurial/osutil.c Sat Mar 25 17:13:12 2017 +0900
@@ -1104,12 +1104,7 @@
return NULL;
memset(&buf, 0, sizeof(buf));
- const char *type = getfstype(path, &buf);
- if (type == NULL)
- Py_RETURN_NONE;
-
- PyObject *result = Py_BuildValue("s", type);
- return result;
+ return Py_BuildValue("s", getfstype(path, &buf));
}
#endif /* defined(HAVE_LINUX_STATFS) || defined(HAVE_BSD_STATFS) */