Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Fix PermissionError when detecting package manager on WSL
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _check_command_available(command: str) -> bool:
try:
subprocess.run([command, "--version"], capture_output=True, check=True)
return True
except (subprocess.CalledProcessError, FileNotFoundError):
except (subprocess.CalledProcessError, FileNotFoundError, PermissionError):
return False


Expand All @@ -50,7 +50,7 @@ def detect_package_manager() -> str:
try:
subprocess.run([sys.executable, "-m", "pip", "--version"], capture_output=True, check=True)
return "python -m pip"
except (subprocess.CalledProcessError, FileNotFoundError):
except (subprocess.CalledProcessError, FileNotFoundError, PermissionError):
pass

raise PackageManagerNotFoundError("No suitable package manager found. Please install either uv or pip.")
Expand Down
Loading