diff -r e9e7eca7efee -r bf71ee032bb4 scripts/uninstall-debugclients.py --- a/scripts/uninstall-debugclients.py Wed Jul 13 11:16:20 2022 +0200 +++ b/scripts/uninstall-debugclients.py Wed Jul 13 14:55:47 2022 +0200 @@ -27,17 +27,17 @@ def exit(rcode=0): """ Exit the install script. - + @param rcode result code to report back (integer) """ global currDir - + if sys.platform.startswith("win"): with contextlib.suppress(): - input("Press enter to continue...") # secok - + input("Press enter to continue...") # secok + os.chdir(currDir) - + sys.exit(rcode) @@ -64,7 +64,7 @@ """ global modDir, pyModDir - modDir = sysconfig.get_path('platlib') + modDir = sysconfig.get_path("platlib") pyModDir = modDir @@ -73,15 +73,14 @@ Uninstall the old eric debug client files. """ global pyModDir - + try: # Cleanup the install directories dirname = os.path.join(pyModDir, installPackage) if os.path.exists(dirname): shutil.rmtree(dirname, True) except OSError as msg: - sys.stderr.write( - 'Error: {0}\nTry uninstall with admin rights.\n'.format(msg)) + sys.stderr.write("Error: {0}\nTry uninstall with admin rights.\n".format(msg)) exit(7) @@ -98,7 +97,7 @@ # Parse the command line. global progName progName = os.path.basename(argv[0]) - + try: optlist, args = getopt.getopt(argv[1:], "hy") except getopt.GetoptError: @@ -107,24 +106,26 @@ for opt, _arg in optlist: if opt in ["-h", "--help"]: usage(0) - + print("\nUninstalling eric debug clients ...") uninstallEricDebugClients() print("\nUninstallation complete.") print() - + exit(0) - - + + if __name__ == "__main__": try: main(sys.argv) except SystemExit: raise except Exception: - print("""An internal error occured. Please report all the output""" - """ of the program,\nincluding the following traceback, to""" - """ eric-bugs@eric-ide.python-projects.org.\n""") + print( + """An internal error occured. Please report all the output""" + """ of the program,\nincluding the following traceback, to""" + """ eric-bugs@eric-ide.python-projects.org.\n""" + ) raise #