diff options
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) |
commit | 37e6c54ba122703a0162dd44cf3eac78c46c8bdd (patch) | |
tree | 1453d6434ce4859948c382ae46cd12034e46fc8a /Lib/distutils/command | |
parent | 6f205ed37eb4b785b60081f957d515ca16b0db47 (diff) | |
parent | 5c1a0c969d82670ba7aac7647b9828f4df85c1bd (diff) | |
download | cpython-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.py | 25 |
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 |