We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70e2e0a commit a49f3a8Copy full SHA for a49f3a8
src/runtime/PythonEngine.cs
@@ -355,12 +355,17 @@ public static void Shutdown()
355
{
356
return;
357
}
358
- if (Exceptions.ErrorOccurred())
+
359
+ using (Py.GIL())
360
- throw new InvalidOperationException(
361
- "Python error indicator is set",
362
- innerException: PythonException.PeekCurrentOrNull(out _));
+ if (Exceptions.ErrorOccurred())
+ {
363
+ throw new InvalidOperationException(
364
+ "Python error indicator is set",
365
+ innerException: PythonException.PeekCurrentOrNull(out _));
366
+ }
367
368
369
// If the shutdown handlers trigger a domain unload,
370
// don't call shutdown again.
371
AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload;
0 commit comments