Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit baadc22

Browse files
authored
Ensure that load only runs once
Fixes #2078.
1 parent 1729698 commit baadc22

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pythonnet/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def load(runtime: Union[clr_loader.Runtime, str, None] = None, **params: str) ->
142142

143143
if func(b"") != 0:
144144
raise RuntimeError("Failed to initialize Python.Runtime.dll")
145+
146+
_LOADED = True
145147

146148
import atexit
147149

0 commit comments

Comments
 (0)