mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix inability to upgrade/downgrade from a Python 3.9 version
Resolves AttributeError: module 'pip_system_certs.wrapt_requests' has no attribute 'inject_truststore'
This commit is contained in:
parent
177c483398
commit
e2692b5ac9
1 changed files with 11 additions and 2 deletions
|
@ -644,8 +644,17 @@ fn fetch_versions(state: &State) -> Result<Vec<String>> {
|
|||
let mut cmd = Command::new(&state.uv_path);
|
||||
cmd.current_dir(&state.uv_install_root)
|
||||
.args(["run", "--no-project", "--no-config", "--managed-python"])
|
||||
.args(["--with", "pip-system-certs"])
|
||||
.arg(&versions_script);
|
||||
.args(["--with", "pip-system-certs"]);
|
||||
|
||||
let python_version = read_file(&state.dist_python_version_path)?;
|
||||
let python_version_str =
|
||||
String::from_utf8(python_version).context("Invalid UTF-8 in .python-version")?;
|
||||
let version_trimmed = python_version_str.trim();
|
||||
if !version_trimmed.is_empty() {
|
||||
cmd.args(["--python", version_trimmed]);
|
||||
}
|
||||
|
||||
cmd.arg(&versions_script);
|
||||
|
||||
let output = match cmd.utf8_output() {
|
||||
Ok(output) => output,
|
||||
|
|
Loading…
Reference in a new issue