mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
Fix resource warning found manually
This commit is contained in:
parent
a0b3c32c7a
commit
dcb22a3936
1 changed files with 13 additions and 10 deletions
|
@ -294,17 +294,20 @@ class sdist(Command):
|
||||||
join_lines=1, lstrip_ws=1, rstrip_ws=1,
|
join_lines=1, lstrip_ws=1, rstrip_ws=1,
|
||||||
collapse_join=1)
|
collapse_join=1)
|
||||||
|
|
||||||
while True:
|
try:
|
||||||
line = template.readline()
|
while True:
|
||||||
if line is None: # end of file
|
line = template.readline()
|
||||||
break
|
if line is None: # end of file
|
||||||
|
break
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.filelist.process_template_line(line)
|
self.filelist.process_template_line(line)
|
||||||
except DistutilsTemplateError as msg:
|
except DistutilsTemplateError as msg:
|
||||||
self.warn("%s, line %d: %s" % (template.filename,
|
self.warn("%s, line %d: %s" % (template.filename,
|
||||||
template.current_line,
|
template.current_line,
|
||||||
msg))
|
msg))
|
||||||
|
finally:
|
||||||
|
template.close()
|
||||||
|
|
||||||
def prune_file_list(self):
|
def prune_file_list(self):
|
||||||
"""Prune off branches that might slip into the file list as created
|
"""Prune off branches that might slip into the file list as created
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue