1
0
Fork 0

Adding upstream version 3.7.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:49:38 +01:00
parent a8737b0b29
commit d24c1558a4
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
7 changed files with 28 additions and 9 deletions

View file

@ -34,7 +34,7 @@ def get_default_version() -> str:
# Just detecting the executable does not suffice, because if rustup is
# installed but no toolchain is available, then `cargo` exists but
# cannot be used without installing a toolchain first.
if cmd_output_b('cargo', '--version', check=False)[0] == 0:
if cmd_output_b('cargo', '--version', check=False, cwd='/')[0] == 0:
return 'system'
else:
return C.DEFAULT

View file

@ -205,10 +205,11 @@ else: # pragma: no cover
def _handle_readonly(
func: Callable[[str], object],
path: str,
exc: OSError,
exc: Exception,
) -> None:
if (
func in (os.rmdir, os.remove, os.unlink) and
isinstance(exc, OSError) and
exc.errno in {errno.EACCES, errno.EPERM}
):
for p in (path, os.path.dirname(path)):
@ -222,7 +223,7 @@ if sys.version_info < (3, 12): # pragma: <3.12 cover
def _handle_readonly_old(
func: Callable[[str], object],
path: str,
excinfo: tuple[type[OSError], OSError, TracebackType],
excinfo: tuple[type[Exception], Exception, TracebackType],
) -> None:
return _handle_readonly(func, path, excinfo[1])