PyLint/PyLintExecDialog.py

changeset 89
8acd446fb6e6
parent 85
6124794c3ffe
child 91
9dc14465123e
--- a/PyLint/PyLintExecDialog.py	Wed Oct 07 19:33:10 2020 +0200
+++ b/PyLint/PyLintExecDialog.py	Wed Oct 14 19:46:35 2020 +0200
@@ -378,10 +378,9 @@
         
         try:
             import codecs
-            f = open(self.reportFile, 'wb')
-            f.write(codecs.BOM_UTF8)
-            f.write(self.buf.encode('utf-8'))
-            f.close()
+            with open(self.reportFile, 'wb') as f:
+                f.write(codecs.BOM_UTF8)
+                f.write(self.buf.encode('utf-8'))
         except IOError as why:
             E5MessageBox.critical(
                 self, self.tr('PyLint Report'),

eric ide

mercurial