def getgrgid(uid): """ getgrgid(id) -> tuple Return the group database entry for the given numeric group ID. If id is not valid, raise KeyError. """ try: return struct_group(_posix.getgrgid(uid)) except NullPointerException: raise KeyError, uid
def getgrgid(uid): """ getgrgid(id) -> tuple Return the group database entry for the given numeric group ID. If id is not valid, raise KeyError. """ entry = _posix.getgrgid(uid) if not entry: raise KeyError(uid) return struct_group(entry)