Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48672e7

Browse files
committed
Ensure thatload only runs once
Fixes#2078.
1 parent1729698 commit48672e7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1313

1414
###Fixed
1515

16-
- Fixed error occuring when inheriting a class containing a virtual generic method.
16+
- Fixed error occuring when inheriting a class containing a virtual generic method.
17+
- Make a second call to`pythonnet.load` a no-op, as it was intended.
1718

1819
##[3.0.1](https://github.com/pythonnet/pythonnet/releases/tag/v3.0.1) - 2022-11-03
1920

‎pythonnet/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def load(runtime: Union[clr_loader.Runtime, str, None] = None, **params: str) ->
120120
121121
The same parameters as for `set_runtime` can be used. By default,
122122
`set_default_runtime` is called if no environment has been set yet and no
123-
parameters are passed."""
123+
parameters are passed.
124+
125+
After a successful call, further invocations will return immediately."""
124126
global_LOADED,_LOADER_ASSEMBLY
125127

126128
if_LOADED:
@@ -142,6 +144,8 @@ def load(runtime: Union[clr_loader.Runtime, str, None] = None, **params: str) ->
142144

143145
iffunc(b"")!=0:
144146
raiseRuntimeError("Failed to initialize Python.Runtime.dll")
147+
148+
_LOADED=True
145149

146150
importatexit
147151

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp