Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d17a90

Browse files
committed
Heh -- I checked in an old version of this, at a time I documented the
internal read() as being a generator but hadn't yet changed it into one.
1 parent 21d7d4d commit 8d17a90

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Tools/scripts/combinerefs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@
7474
# (when whilematch is false), is lost, and fileiter will resume at the line
7575
# following it.
7676
def read(fileiter, pat, whilematch):
77-
result = []
7877
for line in fileiter:
7978
if bool(pat.match(line)) == whilematch:
80-
result.append(line)
79+
yield line
8180
else:
8281
break
83-
return result
8482

8583
def combine(fname):
8684
f = file(fname)

0 commit comments

Comments
 (0)