X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/51b6154866aaf16653af673b9a3dedd5c244eb28..9532a77c8856aab6060a79f152c84551a90f0172:/afs/_pts.pyx diff --git a/afs/_pts.pyx b/afs/_pts.pyx index cce9256..6b6de79 100644 --- a/afs/_pts.pyx +++ b/afs/_pts.pyx @@ -32,6 +32,7 @@ cdef import from "afs/ptuser.h": cdef import from "afs/pterror.h": enum: PRNOENT + PRTOOMANY void initialize_PT_error_table() @@ -264,12 +265,15 @@ cdef class PTS: alist.prlist_val = NULL code = ubik_PR_ListElements(self.client, 0, gid, &alist, &over) - if code != 0: - raise Exception("Failed to get group membership: %s" % afs_error_message(code)) - for i in range(alist.prlist_len): - members.append(alist.prlist_val[i]) if alist.prlist_val is not NULL: + for i in range(alist.prlist_len): + members.append(alist.prlist_val[i]) free(alist.prlist_val) + if over: + code = PRTOOMANY + if code != 0: + raise Exception("Failed to get group membership: %s" % afs_error_message(code)) + return members