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

Skip to content

Commit 6eca282

Browse files
committed
Make a leaner custom patch
1 parent 737453f commit 6eca282

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/runtime/pythonengine.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ public static void Initialize(bool setSysArgv = true, bool initSigs = false, Shu
171171
Initialize(Enumerable.Empty<string>(), setSysArgv: setSysArgv, initSigs: initSigs, mode);
172172
}
173173

174+
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default)
175+
{
176+
if (!initialized)
177+
{
178+
InitializeLibrary();
179+
Initialize2(args,setSysArgv, initSigs);
180+
}
181+
}
182+
174183
/// <summary>
175184
/// Initialize Method
176185
/// </summary>
@@ -181,7 +190,7 @@ public static void Initialize(bool setSysArgv = true, bool initSigs = false, Shu
181190
/// interpreter lock (GIL) to call this method.
182191
/// initSigs can be set to 1 to do default python signal configuration. This will override the way signals are handled by the application.
183192
/// </remarks>
184-
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default)
193+
public static void Initialize2(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default)
185194
{
186195
if (initialized)
187196
{

0 commit comments

Comments
 (0)