Globals.__init__: fixed an issue that caused startup issues on Windows if both _eric6 and .eric6 were existing.

Wed, 22 Aug 2018 16:19:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 22 Aug 2018 16:19:12 +0200
changeset 6474
72c063cc730b
parent 6473
46d9adf29135
child 6475
ed23eb2f20a4

Globals.__init__: fixed an issue that caused startup issues on Windows if both _eric6 and .eric6 were existing.

Globals/__init__.py file | annotate | diff | comparison | revisions
--- a/Globals/__init__.py	Wed Aug 22 11:57:38 2018 +0200
+++ b/Globals/__init__.py	Wed Aug 22 16:19:12 2018 +0200
@@ -16,6 +16,7 @@
 import sys
 import os
 import re
+import shutil
 
 from PyQt5.QtCore import QDir, QLibraryInfo, QByteArray, QCoreApplication, \
     QT_VERSION_STR, QT_VERSION
@@ -174,7 +175,11 @@
             hpOld = os.path.join(os.path.expanduser("~"), cdnOld)
             if os.path.exists(hpOld):
                 hpNew = os.path.join(os.path.expanduser("~"), cdn)
-                os.rename(hpOld, hpNew)
+                if os.path.exists(hpNew):
+                    # simply delete the old config directory
+                    shutil.rmtree(hpOld,  True)
+                else:
+                    os.rename(hpOld, hpNew)
         
         hp = os.path.join(os.path.expanduser("~"), cdn)
         if not os.path.exists(hp):

eric ide

mercurial