We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75992f2 commit 2401703Copy full SHA for 2401703
graalpython/lib-graalpython/modules/ginstall.py
@@ -515,13 +515,16 @@ def main(argv):
515
for pkg in args.package.split(","):
516
deleted = False
517
for p in sys.path:
518
- if p.startswith(user_site) and p.endswith(pkg):
519
- if os.path.isdir(p):
520
- shutil.rmtree(p)
521
- else:
522
- os.unlink(p)
523
- deleted = True
524
- break
+ if p.startswith(user_site):
+ # +1 due to the path separator
+ pkg_name = p[len(user_site)+1:]
+ if pkg_name.startswith(pkg):
+ if os.path.isdir(p):
+ shutil.rmtree(p)
+ else:
525
+ os.unlink(p)
526
+ deleted = True
527
+ break
528
if deleted:
529
print("Deleted %s" % p)
530
else:
0 commit comments