Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More robust check that VIRUAL_ENV is valid
  • Loading branch information
oleksandr-pavlyk committed Dec 7, 2024
commit 231c9c64224a588260873b885223cd3c0a926439
8 changes: 5 additions & 3 deletions dpctl/_init_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# with DPC++ libraries to the DLL search path gh-1745
if "VIRTUAL_ENV" in os.environ:
venv_dir = os.environ["VIRTUAL_ENV"]
expected_dir = os.path.join(venv_dir, "Library", "bin")
if os.path.exists(expected_dir):
os.add_dll_directory(expected_dir)
# Expect to find file per PEP-0405
expected_file = os.path.join(venv_dir, "pyvenv.cfg")
dll_dir = os.path.join(venv_dir, "Library", "bin")
if os.path.isdir(dll_dir) and os.path.isfile(expected_file):
os.add_dll_directory(dll_dir)