Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
b4bc3369
Commit
b4bc3369
authored
Jul 21, 2023
by
Keith Stevens
Browse files
Make sure bitsandbytes handles permission errors in the right order
parent
e229fbce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
bitsandbytes/cuda_setup/main.py
bitsandbytes/cuda_setup/main.py
+5
-3
No files found.
bitsandbytes/cuda_setup/main.py
View file @
b4bc3369
...
@@ -196,11 +196,13 @@ def remove_non_existent_dirs(candidate_paths: Set[Path]) -> Set[Path]:
...
@@ -196,11 +196,13 @@ def remove_non_existent_dirs(candidate_paths: Set[Path]) -> Set[Path]:
try
:
try
:
if
path
.
exists
():
if
path
.
exists
():
existent_directories
.
add
(
path
)
existent_directories
.
add
(
path
)
except
PermissionError
as
pex
:
# Handle the PermissionError first as it is a subtype of OSError
# https://docs.python.org/3/library/exceptions.html#exception-hierarchy
pass
except
OSError
as
exc
:
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
ENAMETOOLONG
:
if
exc
.
errno
!=
errno
.
ENAMETOOLONG
:
raise
exc
raise
exc
except
PermissionError
as
pex
:
pass
non_existent_directories
:
Set
[
Path
]
=
candidate_paths
-
existent_directories
non_existent_directories
:
Set
[
Path
]
=
candidate_paths
-
existent_directories
if
non_existent_directories
:
if
non_existent_directories
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment