mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-14 08:45:01 +00:00
Use specialized error message for invalid Python install / uninstall requests (#5171)
## Summary Closes https://github.com/astral-sh/uv/issues/4819.
This commit is contained in:
parent
622e9e8799
commit
91bf213641
4 changed files with 27 additions and 24 deletions
|
@ -90,7 +90,7 @@ impl PythonInstallation {
|
|||
|
||||
// Perform a fetch aggressively if managed Python is preferred
|
||||
if matches!(preference, PythonPreference::Managed) && python_fetch.is_automatic() {
|
||||
if let Some(request) = PythonDownloadRequest::try_from_request(&request) {
|
||||
if let Some(request) = PythonDownloadRequest::from_request(&request) {
|
||||
return Self::fetch(request.fill(), client_builder, cache, reporter).await;
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ impl PythonInstallation {
|
|||
&& python_fetch.is_automatic()
|
||||
&& client_builder.connectivity.is_online() =>
|
||||
{
|
||||
if let Some(request) = PythonDownloadRequest::try_from_request(&request) {
|
||||
if let Some(request) = PythonDownloadRequest::from_request(&request) {
|
||||
debug!("Requested Python not found, checking for available download...");
|
||||
match Self::fetch(request.fill(), client_builder, cache, reporter).await {
|
||||
Ok(installation) => Ok(installation),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue