Mercurial > python-hglib
comparison hglib/util.py @ 62:d1f57f162274
closefds on posix when using subprocess
see added test for a clarification on why this is needed
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 19 Aug 2011 22:24:14 +0300 |
parents | 3d7e0325ba1c |
children | 15485fa4b35e |
comparison
equal
deleted
inserted
replaced
61:d0b9215180a4 | 62:d1f57f162274 |
---|---|
1 import itertools, cStringIO, error | 1 import itertools, cStringIO, error, os |
2 | |
3 closefds = os.name == 'posix' | |
2 | 4 |
3 def grouper(n, iterable): | 5 def grouper(n, iterable): |
4 ''' list(grouper(2, range(4))) -> [(0, 1), (2, 3)] ''' | 6 ''' list(grouper(2, range(4))) -> [(0, 1), (2, 3)] ''' |
5 args = [iter(iterable)] * n | 7 args = [iter(iterable)] * n |
6 return itertools.izip(*args) | 8 return itertools.izip(*args) |