Project: fixed an issue creating a new project where the main script is in a package.

Sat, 14 Nov 2020 17:51:47 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 14 Nov 2020 17:51:47 +0100
changeset 7830
72499e626226
parent 7829
5a99dd3ebe5f
child 7831
f358318cab44

Project: fixed an issue creating a new project where the main script is in a package.

eric6/Project/Project.py file | annotate | diff | comparison | revisions
diff -r 5a99dd3ebe5f -r 72499e626226 eric6/Project/Project.py
--- a/eric6/Project/Project.py	Sat Nov 14 11:50:43 2020 +0100
+++ b/eric6/Project/Project.py	Sat Nov 14 17:51:47 2020 +0100
@@ -2362,6 +2362,7 @@
                             self.ppath, self.pdata["MAINSCRIPT"])
                     else:
                         ms = self.pdata["MAINSCRIPT"]
+                    os.makedirs(os.path.dirname(ms))
                     with open(ms, "w"):
                         pass
                     self.appendFile(ms, True)
@@ -2373,6 +2374,7 @@
                             mf = os.path.join(self.ppath, mf)
                     else:
                         mf = os.path.join(self.ppath, Project.DefaultMakefile)
+                    os.makedirs(os.path.dirname(mf))
                     with open(mf, "w"):
                         pass
                     self.appendFile(mf)
@@ -2415,6 +2417,7 @@
                         ms = self.pdata["MAINSCRIPT"]
                     if not os.path.exists(ms):
                         try:
+                            os.makedirs(os.path.dirname(ms))
                             with open(ms, "w"):
                                 pass
                         except EnvironmentError as err:
@@ -2438,6 +2441,7 @@
                         mf = os.path.join(self.ppath, Project.DefaultMakefile)
                     if not os.path.exists(mf):
                         try:
+                            os.makedirs(os.path.dirname(mf))
                             with open(mf, "w"):
                                 pass
                         except EnvironmentError as err:

eric ide

mercurial