@@ -155,9 +155,9 @@ public static void Initialize()
155155 Initialize ( setSysArgv : true ) ;
156156 }
157157
158- public static void Initialize ( bool setSysArgv = true , bool initSigs = false , ShutdownMode mode = ShutdownMode . Default )
158+ public static void Initialize ( bool setSysArgv = true , bool initSigs = false , ShutdownMode mode = ShutdownMode . Default , bool fromPython = false )
159159 {
160- Initialize ( Enumerable . Empty < string > ( ) , setSysArgv : setSysArgv , initSigs : initSigs , mode ) ;
160+ Initialize ( Enumerable . Empty < string > ( ) , setSysArgv : setSysArgv , initSigs : initSigs , mode , fromPython : fromPython ) ;
161161 }
162162
163163 /// <summary>
@@ -170,7 +170,7 @@ public static void Initialize(bool setSysArgv = true, bool initSigs = false, Shu
170170 /// interpreter lock (GIL) to call this method.
171171 /// initSigs can be set to 1 to do default python signal configuration. This will override the way signals are handled by the application.
172172 /// </remarks>
173- public static void Initialize ( IEnumerable < string > args , bool setSysArgv = true , bool initSigs = false , ShutdownMode mode = ShutdownMode . Default )
173+ public static void Initialize ( IEnumerable < string > args , bool setSysArgv = true , bool initSigs = false , ShutdownMode mode = ShutdownMode . Default , bool fromPython = false )
174174 {
175175 if ( initialized )
176176 {
@@ -182,7 +182,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true,
182182 // during an initial "import clr", and the world ends shortly thereafter.
183183 // This is probably masking some bad mojo happening somewhere in Runtime.Initialize().
184184 delegateManager = new DelegateManager ( ) ;
185- Runtime . Initialize ( initSigs , mode ) ;
185+ Runtime . Initialize ( initSigs , mode , fromPython ) ;
186186 initialized = true ;
187187 Exceptions . Clear ( ) ;
188188
@@ -265,7 +265,7 @@ public static IntPtr InitExt()
265265 {
266266 try
267267 {
268- Initialize ( setSysArgv : false ) ;
268+ Initialize ( setSysArgv : false , fromPython : true ) ;
269269
270270 // Trickery - when the import hook is installed into an already
271271 // running Python, the standard import machinery is still in
0 commit comments