Since we always do:

~~~~~
if (status < 0)
    # get errno
else
    # set errno to None
~~~~~

What if we make this function return None if errorno is 0? That way we'd save a few ifs here and there I think.