eric6/DocumentationTools/IndexGenerator.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
diff -r 3257703e10c5 -r 9978016560ec eric6/DocumentationTools/IndexGenerator.py
--- a/eric6/DocumentationTools/IndexGenerator.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/DocumentationTools/IndexGenerator.py	Wed Oct 14 17:50:39 2020 +0200
@@ -180,9 +180,8 @@
             ) + self.footerTemplate
         )
     
-        f = open(filename, "w", encoding="utf-8", newline=newline)
-        f.write(doc)
-        f.close()
+        with open(filename, "w", encoding="utf-8", newline=newline) as f:
+            f.write(doc)
     
         return filename
     

eric ide

mercurial