Skip to content

Commit

Permalink
fix issue #44
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed Apr 29, 2024
1 parent 355fd50 commit 063cb8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion msl/loadlib/load_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ def __init__(self,
# runtime and cannot be loaded in the 4.0 runtime without additional
# configuration information. "
if str(err).startswith('Mixed mode assembly is built against version'):
status, msg = utils.check_dot_net_config(sys.executable)
py_exe = sys.executable
if sys.prefix != sys.base_prefix:
# Python is running in a venv/virtualenv
# When using conda environments, sys.prefix == sys.base_prefix
py_exe = os.path.join(sys.base_prefix, os.path.basename(py_exe))
status, msg = utils.check_dot_net_config(py_exe)
if not status == 0:
raise OSError(msg)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dotnet_legacy_v2_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from conftest import skipif_not_windows
from msl.loadlib import LoadLibrary

config_path = f'{sys.executable}.config'
config_path = os.path.join(sys.base_prefix, os.path.basename(sys.executable)+'.config')


def teardown_module():
Expand Down

0 comments on commit 063cb8b

Please sign in to comment.