Skip to content

Commit b32ed13

Browse files
committed
Systematically replace previously overlooked relative imports with absolute imports.
1 parent c55104c commit b32ed13

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

cuda_bindings/cuda/bindings/_path_finder/load_dl_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def abs_path_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> Optional[
4040
Raises:
4141
OSError: If dladdr fails to get information about the symbol
4242
"""
43-
from .supported_libs import EXPECTED_LIB_SYMBOLS
43+
from cuda.bindings._path_finder.supported_libs import EXPECTED_LIB_SYMBOLS
4444

4545
for symbol_name in EXPECTED_LIB_SYMBOLS[libname]:
4646
symbol = getattr(handle, symbol_name, None)
@@ -70,7 +70,7 @@ def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]:
7070
>>> if loaded is not None:
7171
... print(f"Library already loaded from {loaded.abs_path}")
7272
"""
73-
from .supported_libs import SUPPORTED_LINUX_SONAMES
73+
from cuda.bindings._path_finder.supported_libs import SUPPORTED_LINUX_SONAMES
7474

7575
for soname in SUPPORTED_LINUX_SONAMES.get(libname, ()):
7676
try:

cuda_bindings/cuda/bindings/_path_finder/load_dl_windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]:
9191
>>> if loaded is not None:
9292
... print(f"Library already loaded from {loaded.abs_path}")
9393
"""
94-
from .supported_libs import SUPPORTED_WINDOWS_DLLS
94+
from cuda.bindings._path_finder.supported_libs import SUPPORTED_WINDOWS_DLLS
9595

9696
for dll_name in SUPPORTED_WINDOWS_DLLS.get(libname, ()):
9797
try:
@@ -113,7 +113,7 @@ def load_with_system_search(libname: str, _unused: str) -> Optional[LoadedDL]:
113113
Returns:
114114
A LoadedDL object if successful, None if the library cannot be loaded
115115
"""
116-
from .supported_libs import SUPPORTED_WINDOWS_DLLS
116+
from cuda.bindings._path_finder.supported_libs import SUPPORTED_WINDOWS_DLLS
117117

118118
dll_names = SUPPORTED_WINDOWS_DLLS.get(libname)
119119
if dll_names is None:
@@ -140,7 +140,7 @@ def load_with_abs_path(libname: str, found_path: str) -> LoadedDL:
140140
Raises:
141141
RuntimeError: If the DLL cannot be loaded
142142
"""
143-
from .supported_libs import LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY
143+
from cuda.bindings._path_finder.supported_libs import LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY
144144

145145
if libname in LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY:
146146
add_dll_directory(found_path)

cuda_bindings/cuda/bindings/_path_finder/load_nvidia_dynamic_library.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@
88
from cuda.bindings._path_finder.load_dl_common import LoadedDL, load_dependencies
99

1010
if sys.platform == "win32":
11-
from .load_dl_windows import check_if_already_loaded_from_elsewhere, load_with_abs_path, load_with_system_search
11+
from cuda.bindings._path_finder.load_dl_windows import (
12+
check_if_already_loaded_from_elsewhere,
13+
load_with_abs_path,
14+
load_with_system_search,
15+
)
1216
else:
13-
from .load_dl_linux import check_if_already_loaded_from_elsewhere, load_with_abs_path, load_with_system_search
17+
from cuda.bindings._path_finder.load_dl_linux import (
18+
check_if_already_loaded_from_elsewhere,
19+
load_with_abs_path,
20+
load_with_system_search,
21+
)
1422

1523

1624
def _load_nvidia_dynamic_library_no_cache(libname: str) -> LoadedDL:

0 commit comments

Comments
 (0)