Project: fixed an issue creating new projects.

Sun, 28 Feb 2021 19:30:20 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 28 Feb 2021 19:30:20 +0100
changeset 8140
61113590d4ab
parent 8139
418c2d9a767d
child 8141
27f636beebad

Project: fixed an issue creating new projects.

eric6/Project/Project.py file | annotate | diff | comparison | revisions
diff -r 418c2d9a767d -r 61113590d4ab eric6/Project/Project.py
--- a/eric6/Project/Project.py	Sat Feb 27 16:57:26 2021 +0100
+++ b/eric6/Project/Project.py	Sun Feb 28 19:30:20 2021 +0100
@@ -2406,7 +2406,7 @@
                             self.ppath, self.pdata["MAINSCRIPT"])
                     else:
                         ms = self.pdata["MAINSCRIPT"]
-                    os.makedirs(os.path.dirname(ms))
+                    os.makedirs(os.path.dirname(ms), exist_ok=True)
                     with open(ms, "w"):
                         pass
                     self.appendFile(ms, True)
@@ -2418,7 +2418,7 @@
                             mf = os.path.join(self.ppath, mf)
                     else:
                         mf = os.path.join(self.ppath, Project.DefaultMakefile)
-                    os.makedirs(os.path.dirname(mf))
+                    os.makedirs(os.path.dirname(mf), exist_ok=True)
                     with open(mf, "w"):
                         pass
                     self.appendFile(mf)
@@ -2427,12 +2427,12 @@
                 if not self.translationsRoot.endswith(os.sep):
                     tpd = os.path.dirname(tpd)
                 if not os.path.isdir(tpd):
-                    os.makedirs(tpd)
+                    os.makedirs(tpd, exist_ok=True)
                 if self.pdata["TRANSLATIONSBINPATH"]:
                     tpd = os.path.join(
                         self.ppath, self.pdata["TRANSLATIONSBINPATH"])
                     if not os.path.isdir(tpd):
-                        os.makedirs(tpd)
+                        os.makedirs(tpd, exist_ok=True)
                 
                 # create management directory if not present
                 self.createProjectManagementDir()

eric ide

mercurial