[pypy-svn] pypy default: posix.getgroups: fixed the conversion from array to list
berdario
commits-noreply at bitbucket.org
Mon Jan 24 14:38:03 CET 2011
Author: Dario Bertini <berdario at gmail.com>
Branch:
Changeset: r41257:4aecefb8637b
Date: 2011-01-24 11:10 +0100
http://bitbucket.org/pypy/pypy/changeset/4aecefb8637b/
Log: posix.getgroups: fixed the conversion from array to list
diff --git a/pypy/rpython/module/ll_os.py b/pypy/rpython/module/ll_os.py
--- a/pypy/rpython/module/ll_os.py
+++ b/pypy/rpython/module/ll_os.py
@@ -691,7 +691,7 @@
lltype.free(groups, flavor='raw')
groups = lltype.malloc(GP.TO, n, flavor='raw')
n = c_getgroups(n,groups)
- result = [g for g in groups]
+ result = [groups[i] for i in range(n)]
if n >= 0:
return result
raise OSError(rposix.get_errno(), "os_getgroups failed")
More information about the Pypy-commit
mailing list