fix(cli): handle exception in remove() (#31982)

This commit is contained in:
Michael Li 2025-07-17 00:23:02 +10:00 committed by GitHub
parent e2dc36b126
commit 5a4c0c0816
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -334,8 +334,8 @@ def remove(
shutil.rmtree(package_dir)
remove_deps.append(api_path)
except Exception: # noqa: S110
pass
except OSError as exc:
typer.echo(f"Failed to remove {api_path}: {exc}")
try:
remove_dependencies_from_pyproject_toml(project_pyproject, remove_deps)