mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Made more extensive usage of context managers with open.
This commit is contained in:
parent
ec5423df05
commit
865cd35c9b
33 changed files with 178 additions and 233 deletions
|
@ -210,8 +210,7 @@ class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder):
|
|||
if t == "templatefilter" and l == "ref/templates/builtins"],
|
||||
}
|
||||
outfilename = os.path.join(self.outdir, "templatebuiltins.js")
|
||||
f = open(outfilename, 'wb')
|
||||
f.write('var django_template_builtins = ')
|
||||
json.dump(templatebuiltins, f)
|
||||
f.write(';\n')
|
||||
f.close();
|
||||
with open(outfilename, 'wb') as fp:
|
||||
fp.write('var django_template_builtins = ')
|
||||
json.dump(templatebuiltins, fp)
|
||||
fp.write(';\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue