mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Made more extensive usage of context managers with open.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user