summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
commit37e6c54ba122703a0162dd44cf3eac78c46c8bdd (patch)
tree1453d6434ce4859948c382ae46cd12034e46fc8a /Lib/distutils/command
parent6f205ed37eb4b785b60081f957d515ca16b0db47 (diff)
parent5c1a0c969d82670ba7aac7647b9828f4df85c1bd (diff)
downloadcpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.zip
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.gz
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.bz2
Merge 3.1
Diffstat (limited to 'Lib/distutils/command')
-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 1118060..fdbebd7 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -294,17 +294,20 @@ class sdist(Command):
join_lines=1, lstrip_ws=1, rstrip_ws=1,
collapse_join=1)
- while True:
- line = template.readline()
- if line is None: # end of file
- break
-
- try:
- self.filelist.process_template_line(line)
- except DistutilsTemplateError as msg:
- self.warn("%s, line %d: %s" % (template.filename,
- template.current_line,
- msg))
+ try:
+ while True:
+ line = template.readline()
+ if line is None: # end of file
+ break
+
+ try:
+ self.filelist.process_template_line(line)
+ except DistutilsTemplateError as 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