eric6/CondaInterface/CondaExportDialog.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
--- a/eric6/CondaInterface/CondaExportDialog.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/CondaInterface/CondaExportDialog.py	Wed Oct 14 17:50:39 2020 +0200
@@ -183,9 +183,8 @@
                 return
         
         try:
-            f = open(fileName, "w")
-            f.write(self.requirementsEdit.toPlainText())
-            f.close()
+            with open(fileName, "w") as f:
+                f.write(self.requirementsEdit.toPlainText())
         except (OSError, IOError) as err:
             E5MessageBox.critical(
                 self,

eric ide

mercurial