Globals/__init__.py

changeset 6474
72c063cc730b
parent 6366
6c1cd7e2902a
child 6530
25b9dcfd6fcc
diff -r 46d9adf29135 -r 72c063cc730b Globals/__init__.py
--- 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