Undefined values in libfdisk should map to None type in Python. Py_BuildValue("%d", -1); is also incorrectly formatted and raises an error when executed.