eric6/Plugins/PluginWizardEricPlugin.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
--- a/eric6/Plugins/PluginWizardEricPlugin.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/Plugins/PluginWizardEricPlugin.py	Wed Oct 14 17:50:39 2020 +0200
@@ -166,8 +166,8 @@
                     packageFile = os.path.join(packagePath, "__init__.py")
                     if not os.path.exists(packageFile):
                         try:
-                            f = open(packageFile, "w", encoding="utf-8")
-                            f.close()
+                            with open(packageFile, "w", encoding="utf-8"):
+                                pass
                         except IOError as err:
                             E5MessageBox.critical(
                                 self,

eric ide

mercurial