diff options
| 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) |
| commit | cfa8483051554b0e300b4b0c4a84c65bd2819cd3 (patch) | |
| tree | bee40781a6ac3047269fe8ac195008de4ec181fb /Lib/distutils/command/sdist.py | |
| parent | 941592aa19c3419a04a253c8897b672fe88cbae3 (diff) | |
| parent | 2a53d33dc61e782c091ea8319ca0098ed2ff36a8 (diff) | |
| download | cpython-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.py | 25 |
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 |
