--- a/scripts/install.py Sat Nov 21 19:31:16 2020 +0100 +++ b/scripts/install.py Sun Nov 22 16:04:59 2020 +0100 @@ -574,7 +574,7 @@ if sys.platform == "darwin": # delete the Mac app bundle cleanUpMacAppBundle() - except (IOError, OSError) as msg: + except OSError as msg: sys.stderr.write( 'Error: {0}\nTry install with admin rights.\n'.format(msg)) exit(7) @@ -671,7 +671,7 @@ if os.path.exists(linkPath): try: os.remove(linkPath) - except EnvironmentError: + except OSError: # maybe restrictions prohibited link removal print("Could not remove '{0}'.".format(linkPath)) @@ -684,7 +684,7 @@ if os.path.exists(eric6EntryPath): try: shutil.rmtree(eric6EntryPath) - except EnvironmentError: + except OSError: # maybe restrictions prohibited link removal print("Could not remove '{0}'.".format(eric6EntryPath)) @@ -826,7 +826,7 @@ # create the global plugins directory createGlobalPluginsDir() - except (IOError, OSError) as msg: + except OSError as msg: sys.stderr.write( 'Error: {0}\nTry install with admin rights.\n'.format(msg)) return(7) @@ -836,13 +836,13 @@ try: shutilCopy(os.path.join(sourceDir, "docs", name), cfg['ericDocDir']) - except EnvironmentError: + except OSError: print("Could not install '{0}'.".format( os.path.join(sourceDir, "docs", name))) for name in glob.glob(os.path.join(sourceDir, 'docs', 'README*.*')): try: shutilCopy(name, cfg['ericDocDir']) - except EnvironmentError: + except OSError: print("Could not install '{0}'.".format(name)) # copy some more stuff @@ -850,7 +850,7 @@ try: shutilCopy(os.path.join(sourceDir, "others", name), cfg['ericOthersDir']) - except EnvironmentError: + except OSError: print("Could not install '{0}'.".format( os.path.join(sourceDir, "others", name))) @@ -866,14 +866,14 @@ progLanguage, "*.api")): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) for apiName in glob.glob(os.path.join(eric6SourceDir, "APIs", progLanguage, "*.bas")): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) if progLanguage == "Python": @@ -882,7 +882,7 @@ "Python3", "*.api")): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) for apiName in glob.glob(os.path.join(eric6SourceDir, "APIs", @@ -892,7 +892,7 @@ apiName.replace(".bas", ".api")))): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) @@ -901,7 +901,7 @@ "MicroPython", "*.api")): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) for apiName in glob.glob(os.path.join(eric6SourceDir, "APIs", @@ -911,7 +911,7 @@ apiName.replace(".bas", ".api")))): try: shutilCopy(apiName, apidir) - except EnvironmentError: + except OSError: print("Could not install '{0}' (no permission)." .format(apiName)) @@ -1065,7 +1065,7 @@ if not os.path.exists(eric6EntryPath): try: os.makedirs(eric6EntryPath) - except EnvironmentError: + except OSError: # maybe restrictions prohibited link creation return @@ -1737,7 +1737,7 @@ try: os.rename(fileName, fileName + ".orig") - except EnvironmentError: + except OSError: pass try: hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok @@ -1985,7 +1985,7 @@ if os.path.exists(configNameC): os.remove(configNameC) os.remove(configName) - except EnvironmentError: + except OSError: pass # cleanup old installation @@ -1996,7 +1996,7 @@ shutil.rmtree(distDir, True) else: cleanUp() - except (IOError, OSError) as msg: + except OSError as msg: sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg)) exit(7) @@ -2052,7 +2052,7 @@ if os.path.exists(configNameC): os.remove(configNameC) os.rename(configName + ".orig", configName) - except EnvironmentError: + except OSError: pass try: if installFromSource and infoName: @@ -2061,7 +2061,7 @@ if os.path.exists(infoNameC): os.remove(infoNameC) os.rename(infoName + ".orig", infoName) - except EnvironmentError: + except OSError: pass print("\nInstallation complete.")