install.py

branch
5_3_x
changeset 2422
21509a6de6e0
parent 2384
ab316924b76a
child 2429
a68c882ad6cc
--- a/install.py	Sat Feb 16 15:09:18 2013 +0100
+++ b/install.py	Sat Feb 16 16:30:26 2013 +0100
@@ -403,12 +403,8 @@
             if os.path.exists("/Applications/" + macAppBundleName):
                 shutil.rmtree("/Applications/" + macAppBundleName)
         
-    except IOError as msg:
-        sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
-        exit(7)
-        
-    except OSError as msg:
-        sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
+    except (IOError, OSError) as msg:
+        sys.stderr.write('Error: {0}\nTry install with admin rights.\n'.format(msg))
         exit(7)
 
 
@@ -522,12 +518,8 @@
         # create the global plugins directory
         createGlobalPluginsDir()
         
-    except IOError as msg:
-        sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
-        return(7)
-        
-    except OSError as msg:
-        sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
+    except (IOError, OSError) as msg:
+        sys.stderr.write('Error: {0}\nTry install with admin rights.\n'.format(msg))
         return(7)
     
     # copy some text files to the doc area
@@ -1102,8 +1094,9 @@
                 shutil.rmtree(distDir, True)
             else:
                 cleanUp()
-    except IOError as msg:
-        sys.stderr.write('IOError: {0}\nTry install as root.\n'.format(msg))
+    except (IOError, OSError) as msg:
+        sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg))
+        exit(7)
 
     # Create a config file and delete the default one
     createConfig()

eric ide

mercurial