eric6/PipInterface/PipPackagesWidget.py

changeset 7785
9978016560ec
parent 7775
4a1db75550bd
child 7826
704c46e040a2
--- a/eric6/PipInterface/PipPackagesWidget.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/PipInterface/PipPackagesWidget.py	Wed Oct 14 17:50:39 2020 +0200
@@ -1147,9 +1147,8 @@
         
         if not os.path.exists(cfgFile):
             try:
-                f = open(cfgFile, "w")
-                f.write("[global]\n")
-                f.close()
+                with open(cfgFile, "w") as f:
+                    f.write("[global]\n")
             except (IOError, OSError):
                 # ignore these
                 pass

eric ide

mercurial