scripts/uninstall-debugclients.py

branch
eric7-maintenance
changeset 10460
3b34efa2857c
parent 10439
21c28b0f9e41
child 10781
0e3d6e22efaf
equal deleted inserted replaced
10366:411df92e881f 10460:3b34efa2857c
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 # Copyright (c) 2016 - 2023 Detlev Offenbach <detlev@die-offenbachs.de> 4 # Copyright (c) 2016 - 2024 Detlev Offenbach <detlev@die-offenbachs.de>
5 # 5 #
6 # This is the uninstall script for the eric debug client. 6 # This is the uninstall script for the eric debug client.
7 # 7 #
8 8
9 """ 9 """
26 26
27 def exit(rcode=0): 27 def exit(rcode=0):
28 """ 28 """
29 Exit the install script. 29 Exit the install script.
30 30
31 @param rcode result code to report back (integer) 31 @param rcode result code to report back
32 @type int
32 """ 33 """
33 global currDir 34 global currDir
34 35
35 if sys.platform.startswith("win"): 36 if sys.platform.startswith("win"):
36 with contextlib.suppress(EOFError): 37 with contextlib.suppress(EOFError):
69 70
70 try: 71 try:
71 # Cleanup the install directories 72 # Cleanup the install directories
72 dirname = os.path.join(pyModDir, installPackage) 73 dirname = os.path.join(pyModDir, installPackage)
73 if os.path.exists(dirname): 74 if os.path.exists(dirname):
74 shutil.rmtree(dirname, True) 75 shutil.rmtree(dirname, ignore_errors=True)
75 except OSError as msg: 76 except OSError as msg:
76 sys.stderr.write("Error: {0}\nTry uninstall with admin rights.\n".format(msg)) 77 sys.stderr.write("Error: {0}\nTry uninstall with admin rights.\n".format(msg))
77 exit(7) 78 exit(7)
78 79
79 80

eric ide

mercurial