Skip to content

Commit

Permalink
Fixed bug causing iglob to coerce iterator to list
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin van der Burgh committed Jul 27, 2016
1 parent ceb8658 commit b5a53b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion glob2/impl.py
Expand Up @@ -5,6 +5,7 @@
import sys
import os
import re
import itertools
from . import fnmatch


Expand Down Expand Up @@ -72,7 +73,7 @@ def iglob(self, pathname, with_matches=False, include_hidden=False):
result = self._iglob(pathname, include_hidden=include_hidden)
if with_matches:
return result
return map(lambda s: s[0], result)
return itertools.imap(lambda s: s[0], result)

def _iglob(self, pathname, rootcall=True, include_hidden=False):
"""Internal implementation that backs :meth:`iglob`.
Expand Down

0 comments on commit b5a53b1

Please sign in to comment.