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
a58cc5a1
Commit
a58cc5a1
authored
Sep 15, 2022
by
Tom Aarsen
Browse files
Prevent OSError when env variables contain long value
parent
9b5f2eda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
bitsandbytes/cuda_setup/paths.py
bitsandbytes/cuda_setup/paths.py
+11
-5
No files found.
bitsandbytes/cuda_setup/paths.py
View file @
a58cc5a1
import
errno
from
pathlib
import
Path
from
typing
import
Set
,
Union
from
warnings
import
warn
...
...
@@ -12,17 +13,22 @@ def extract_candidate_paths(paths_list_candidate: str) -> Set[Path]:
def
remove_non_existent_dirs
(
candidate_paths
:
Set
[
Path
])
->
Set
[
Path
]:
non_existent_directories
:
Set
[
Path
]
=
{
path
for
path
in
candidate_paths
if
not
path
.
exists
()
}
existent_directories
:
Set
[
Path
]
=
set
()
for
path
in
candidate_paths
:
try
:
if
path
.
exists
():
existent_directories
.
add
(
path
)
except
errno
.
ENAMETOOLONG
:
pass
non_existent_directories
:
Set
[
Path
]
=
candidate_paths
-
existent_directories
if
non_existent_directories
:
warn
(
"WARNING: The following directories listed in your path were found to "
f
"be non-existent:
{
non_existent_directories
}
"
)
return
candidate_paths
-
non_
existent_directories
return
existent_directories
def
get_cuda_runtime_lib_paths
(
candidate_paths
:
Set
[
Path
])
->
Set
[
Path
]:
...
...
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