Commit c9e28986 authored by Éric Araujo's avatar Éric Araujo

Fix file handle leak

parent 14b28f28
...@@ -306,6 +306,7 @@ class sdist(Command): ...@@ -306,6 +306,7 @@ class sdist(Command):
rstrip_ws=1, rstrip_ws=1,
collapse_join=1) collapse_join=1)
try:
while 1: while 1:
line = template.readline() line = template.readline()
if line is None: # end of file if line is None: # end of file
...@@ -317,6 +318,8 @@ class sdist(Command): ...@@ -317,6 +318,8 @@ class sdist(Command):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment