Skip to content

Commit 2ee1497

Browse files
committed
adjust windows-platform-specific initialization logic
1 parent 77a90bf commit 2ee1497

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

dpnp/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@
4040
# where to search for DLLs towards both DPNP backend and DPCTL Sycl interface,
4141
# otherwise DPNP import will be failing. This is because the libraries
4242
# are not installed under any of default paths where Python is searching.
43-
from platform import system
44-
45-
if system() == "Windows": # pragma: no cover
46-
if hasattr(os, "add_dll_directory"):
47-
os.add_dll_directory(mypath)
48-
os.add_dll_directory(dpctlpath)
4943

44+
if sys.platform == "win32": # pragma: no cover
45+
os.add_dll_directory(mypath)
46+
os.add_dll_directory(dpctlpath)
5047
os.environ["PATH"] = os.pathsep.join(
5148
[os.getenv("PATH", ""), mypath, dpctlpath]
5249
)
53-
5450
# For virtual environments on Windows, add folder with DPC++ libraries
5551
# to the DLL search path
5652
if sys.base_exec_prefix != sys.exec_prefix and os.path.isfile(

0 commit comments

Comments
 (0)