[Python-checkins] r84494 - in python/branches/release27-maint: Lib/test/test_posix.py

antoine.pitrou python-checkins at python.org
Sat Sep 4 19:34:12 CEST 2010


Author: antoine.pitrou
Date: Sat Sep  4 19:34:12 2010
New Revision: 84494

Log:
Merged revisions 84492 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84492 | antoine.pitrou | 2010-09-04 19:32:06 +0200 (sam., 04 sept. 2010) | 4 lines
  
  Issue #9581: Fix non-working PosixGroupsTester test case
  (it only runs as root, which is why nobody bothered about the failure)
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Lib/test/test_posix.py

Modified: python/branches/release27-maint/Lib/test/test_posix.py
==============================================================================
--- python/branches/release27-maint/Lib/test/test_posix.py	(original)
+++ python/branches/release27-maint/Lib/test/test_posix.py	Sat Sep  4 19:34:12 2010
@@ -400,13 +400,7 @@
     def test_initgroups(self):
         # find missing group
 
-        groups = sorted(self.saved_groups)
-        for g1,g2 in zip(groups[:-1], groups[1:]):
-            g = g1 + 1
-            if g < g2:
-                break
-        else:
-            g = g2 + 1
+        g = max(self.saved_groups) + 1
         name = pwd.getpwuid(posix.getuid()).pw_name
         posix.initgroups(name, g)
         self.assertIn(g, posix.getgroups())


More information about the Python-checkins mailing list