File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,8 @@ internal static void Initialize(bool initSigs = false)
340
340
PyList_Append ( new BorrowedReference ( path ) , item ) ;
341
341
XDecref ( item ) ;
342
342
AssemblyManager . UpdatePath ( ) ;
343
+
344
+ inspect = GetInspectModuleLazy ( ) ;
343
345
}
344
346
345
347
/// <summary>
@@ -431,6 +433,9 @@ internal static void Shutdown()
431
433
Py_Finalize ( ) ;
432
434
}
433
435
436
+ private static Lazy < PyObject > GetInspectModuleLazy ( )
437
+ => new Lazy < PyObject > ( ( ) => PythonEngine . ImportModule ( "inspect" ) , isThreadSafe : false ) ;
438
+
434
439
// called *without* the GIL acquired by clr._AtExit
435
440
internal static int AtExit ( )
436
441
{
@@ -509,8 +514,7 @@ public static PyObject None
509
514
}
510
515
}
511
516
512
- private static readonly Lazy < PyObject > inspect =
513
- new Lazy < PyObject > ( ( ) => PythonEngine . ImportModule ( "inspect" ) , isThreadSafe : false ) ;
517
+ private static Lazy < PyObject > inspect ;
514
518
public static PyObject InspectModule => inspect . Value ;
515
519
516
520
/// <summary>
You can’t perform that action at this time.
0 commit comments