summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
commitcfa8483051554b0e300b4b0c4a84c65bd2819cd3 (patch)
treebee40781a6ac3047269fe8ac195008de4ec181fb /Lib/distutils/command/sdist.py
parent941592aa19c3419a04a253c8897b672fe88cbae3 (diff)
parent2a53d33dc61e782c091ea8319ca0098ed2ff36a8 (diff)
downloadcpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.zip
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.gz
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.bz2
Branch merge
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r--Lib/distutils/command/sdist.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 0c3b0b5..cf8982b 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -306,17 +306,20 @@ class sdist(Command):
rstrip_ws=1,
collapse_join=1)
- while 1:
- line = template.readline()
- if line is None: # end of file
- break
-
- try:
- self.filelist.process_template_line(line)
- except DistutilsTemplateError, msg:
- self.warn("%s, line %d: %s" % (template.filename,
- template.current_line,
- msg))
+ try:
+ while 1:
+ line = template.readline()
+ if line is None: # end of file
+ break
+
+ try:
+ self.filelist.process_template_line(line)
+ except DistutilsTemplateError, msg:
+ self.warn("%s, line %d: %s" % (template.filename,
+ template.current_line,
+ msg))
+ finally:
+ template.close()
def prune_file_list(self):
"""Prune off branches that might slip into the file list as created