Commit b5d30892 by Chris Wanstrath

Explicitly close the template file after reading it

parent a1d46105
......@@ -30,7 +30,10 @@ class View(object):
name = self.template_name() + '.' + self.template_extension
self.template_file = os.path.join(self.template_path, name)
return open(self.template_file, 'r').read()
f = open(self.template_file, 'r')
template = f.read()
f.close()
return template
def template_name(self):
return self.__class__.__name__
......
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