summaryrefslogtreecommitdiff
path: root/pystache/view.py
diff options
context:
space:
mode:
Diffstat (limited to 'pystache/view.py')
-rw-r--r--pystache/view.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pystache/view.py b/pystache/view.py
index bbed285..15c6942 100644
--- a/pystache/view.py
+++ b/pystache/view.py
@@ -55,8 +55,10 @@ class View(object):
self.template_file = os.path.join(self.template_path, name)
f = open(self.template_file, 'r')
- template = f.read()
- f.close()
+ try:
+ template = f.read()
+ finally:
+ f.close()
return template
def get_template_name(self, name=None):