diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-04-24 00:39:43 (GMT) |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-04-24 00:39:43 (GMT) |
| commit | cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9 (patch) | |
| tree | 786ea49a8c479b6cc89f6801925bcadd3786c9b5 /Lib/distutils/command/sdist.py | |
| parent | 5569e9b1507ac0ff18fec433a7733a0185dde7b0 (diff) | |
| parent | 37e6c54ba122703a0162dd44cf3eac78c46c8bdd (diff) | |
| download | cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.zip cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.tar.gz cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.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 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 |
