summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-04-20 18:22:57 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-04-20 18:22:57 (GMT)
commitab20b164b95fc9daaf5dbbb08bce6da2135d34ed (patch)
tree1cc3b189f247e9ba66073a18e9a4854e0c8afaa7 /Lib/distutils/command/sdist.py
parent64e564b8f5de1f1822f051f98d3b247bdd001f74 (diff)
parent37e6c54ba122703a0162dd44cf3eac78c46c8bdd (diff)
downloadcpython-ab20b164b95fc9daaf5dbbb08bce6da2135d34ed.zip
cpython-ab20b164b95fc9daaf5dbbb08bce6da2135d34ed.tar.gz
cpython-ab20b164b95fc9daaf5dbbb08bce6da2135d34ed.tar.bz2
Merge 3.2
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 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