"git@developer.sourcefind.cn:OpenDAS/bitsandbytes.git" did not exist on "5a4263f4dc05fe8f78f4111beab9f68a81deeab1"
Commit b4bc3369 authored by Keith Stevens's avatar Keith Stevens
Browse files

Make sure bitsandbytes handles permission errors in the right order

parent e229fbce
...@@ -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:
...@@ -361,4 +363,4 @@ def evaluate_cuda_setup(): ...@@ -361,4 +363,4 @@ def evaluate_cuda_setup():
"if not has_cublaslt (CC < 7.5), then we have to choose _nocublaslt.so" "if not has_cublaslt (CC < 7.5), then we have to choose _nocublaslt.so"
binary_name = f"libbitsandbytes_cuda{cuda_version_string}_nocublaslt.so" binary_name = f"libbitsandbytes_cuda{cuda_version_string}_nocublaslt.so"
return binary_name, cudart_path, cc, cuda_version_string return binary_name, cudart_path, cc, cuda_version_string
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment