File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 1+ import errno
12from pathlib import Path
23from typing import Set , Union
34from warnings import warn
@@ -12,17 +13,23 @@ def extract_candidate_paths(paths_list_candidate: str) -> Set[Path]:
1213
1314
1415def remove_non_existent_dirs (candidate_paths : Set [Path ]) -> Set [Path ]:
15- non_existent_directories : Set [Path ] = {
16- path for path in candidate_paths if not path .exists ()
17- }
18-
16+ existent_directories : Set [Path ] = set ()
17+ for path in candidate_paths :
18+ try :
19+ if path .exists ():
20+ existent_directories .add (path )
21+ except OSError as exc :
22+ if exc .errno != errno .ENAMETOOLONG :
23+ raise exc
24+
25+ non_existent_directories : Set [Path ] = candidate_paths - existent_directories
1926 if non_existent_directories :
2027 warn (
2128 "WARNING: The following directories listed in your path were found to "
2229 f"be non-existent: { non_existent_directories } "
2330 )
2431
25- return candidate_paths - non_existent_directories
32+ return existent_directories
2633
2734
2835def get_cuda_runtime_lib_paths (candidate_paths : Set [Path ]) -> Set [Path ]:
You can’t perform that action at this time.
0 commit comments