1- using System ;
1+ using System ;
22using System . Collections . Generic ;
33using System . IO ;
44using System . Linq ;
@@ -164,6 +164,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
164164 // during an initial "import clr", and the world ends shortly thereafter.
165165 // This is probably masking some bad mojo happening somewhere in Runtime.Initialize().
166166 delegateManager = new DelegateManager ( ) ;
167+ Console . WriteLine ( "PythonEngine.Initialize(): Runtime.Initialize()..." ) ;
167168 Runtime . Initialize ( ) ;
168169 initialized = true ;
169170 Exceptions . Clear ( ) ;
@@ -179,9 +180,11 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
179180 string code =
180181 "import atexit, clr\n " +
181182 "atexit.register(clr._AtExit)\n " ;
183+ Console . WriteLine ( "PythonEngine.Initialize(): register atexit callback..." ) ;
182184 PythonEngine . Exec ( code ) ;
183185
184186 // Load the clr.py resource into the clr module
187+ Console . WriteLine ( "PythonEngine.Initialize(): GetCLRModule()..." ) ;
185188 IntPtr clr = Python . Runtime . ImportHook . GetCLRModule ( ) ;
186189 IntPtr clr_dict = Runtime . PyModule_GetDict ( clr ) ;
187190
@@ -193,6 +196,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
193196 IntPtr builtins = Runtime . PyEval_GetBuiltins ( ) ;
194197 Runtime . PyDict_SetItemString ( module_globals , "__builtins__" , builtins ) ;
195198
199+ Console . WriteLine ( "PythonEngine.Initialize(): clr GetManifestResourceStream..." ) ;
196200 Assembly assembly = Assembly . GetExecutingAssembly ( ) ;
197201 using ( Stream stream = assembly . GetManifestResourceStream ( "clr.py" ) )
198202 using ( var reader = new StreamReader ( stream ) )
0 commit comments