mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
Explictly close the file handle after reading a documentation page
This commit is contained in:
parent
dda4b930e0
commit
128ef20743
@ -36,10 +36,11 @@ def about(request):
|
||||
def helppage(request, page):
|
||||
"""Serve a help page from the 'doc' directory"""
|
||||
try:
|
||||
input_file = open(os.path.join('doc', '%s.part.html' % page), 'r')
|
||||
with open(os.path.join('doc', '%s.part.html' % page), 'r') \
|
||||
as input_file:
|
||||
main = input_file.read()
|
||||
except IOError:
|
||||
raise Http404
|
||||
main = input_file.read()
|
||||
|
||||
title = _('%s Documentation') % cfg.product_name
|
||||
return TemplateResponse(request, 'base.html',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user