uninstall.py

branch
6_1_x
changeset 5058
41df96c4c8ce
parent 4747
9d9e5ca1eb48
child 5069
10a53320c320
--- a/uninstall.py	Sun Jul 24 16:53:14 2016 +0200
+++ b/uninstall.py	Sun Jul 24 16:51:17 2016 +0200
@@ -50,11 +50,24 @@
     
     @param rcode result code to report back (integer)
     """
+    global currDir
+    
     # restore the local eric6config.py
     if os.path.exists("eric6config.py.orig"):
         if os.path.exists("eric6config.py"):
             os.remove("eric6config.py")
         os.rename("eric6config.py.orig", "eric6config.py")
+    
+    if sys.platform.startswith("win"):
+        # different meaning of input between Py2 and Py3
+        try:
+            input("Press enter to continue...")
+        except (EOFError, SyntaxError):
+            pass
+    
+    os.chdir(currDir)
+    
+    sys.exit(rcode)
 
 
 def usage(rcode=2):
@@ -343,14 +356,10 @@
         if opt == "-y":
             includePythonVariant = True
     
-    try:
-        uninstallEric()
-    except IOError as msg:
-        sys.stderr.write(
-            'IOError: {0}\nTry uninstall with admin rights.\n'.format(msg))
-    except OSError as msg:
-        sys.stderr.write(
-            'OSError: {0}\nTry uninstall with admin rights.\n'.format(msg))
+    print("\nUninstalling eric6 ...")
+    uninstallEric()
+    print("\nUninstallation complete.")
+    print()
     
     exit(0)
 

eric ide

mercurial