summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/combinerefs.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-04-18 01:02:37 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-04-18 01:02:37 (GMT)
commit8d17a90b830ae9b9c672a504f01d4f93bac3d23d (patch)
tree7645ed0212a48d3789631e445cab11bc4076a566 /Tools/scripts/combinerefs.py
parent21d7d4d5ca465e515e40157cfae707d1ec09bb76 (diff)
downloadcpython-8d17a90b830ae9b9c672a504f01d4f93bac3d23d.zip
cpython-8d17a90b830ae9b9c672a504f01d4f93bac3d23d.tar.gz
cpython-8d17a90b830ae9b9c672a504f01d4f93bac3d23d.tar.bz2
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.
Diffstat (limited to 'Tools/scripts/combinerefs.py')
-rw-r--r--Tools/scripts/combinerefs.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Tools/scripts/combinerefs.py b/Tools/scripts/combinerefs.py
index 3fafd9b..edd1a86 100644
--- a/Tools/scripts/combinerefs.py
+++ b/Tools/scripts/combinerefs.py
@@ -74,13 +74,11 @@ import sys
# (when whilematch is false), is lost, and fileiter will resume at the line
# following it.
def read(fileiter, pat, whilematch):
- result = []
for line in fileiter:
if bool(pat.match(line)) == whilematch:
- result.append(line)
+ yield line
else:
break
- return result
def combine(fname):
f = file(fname)