args, bool setSysArgv = true,
AppDomain.CurrentDomain.DomainUnload += OnDomainUnload;
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
- // The global scope gets used implicitly quite early on, remember
- // to clear it out when we shut down.
- AddShutdownHandler(PyScopeManager.Global.Clear);
-
if (setSysArgv)
{
Py.SetArgv(args);
@@ -381,7 +377,6 @@ public static void Shutdown(ShutdownMode mode)
AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload;
AppDomain.CurrentDomain.ProcessExit -= OnProcessExit;
- PyScopeManager.Global.Clear();
ExecuteShutdownHandlers();
// Remember to shut down the runtime.
Runtime.Shutdown(mode);
@@ -694,19 +689,10 @@ public static GILState GIL()
return PythonEngine.DebugGIL ? new DebugGILState() : new GILState();
}
- public static PyScope CreateScope()
- {
- var scope = PyScopeManager.Global.Create();
- return scope;
- }
-
- public static PyScope CreateScope(string name)
- {
- if (name is null) throw new ArgumentNullException(nameof(name));
+ public static PyModule CreateScope() => new();
+ public static PyModule CreateScope(string name)
+ => new(name ?? throw new ArgumentNullException(nameof(name)));
- var scope = PyScopeManager.Global.Create(name);
- return scope;
- }
public class GILState : IDisposable
{
diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs
index e3fba7e80..8cdd6eb70 100644
--- a/src/runtime/runtime.cs
+++ b/src/runtime/runtime.cs
@@ -147,7 +147,6 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd
ABI.Initialize(PyVersion);
GenericUtil.Reset();
- PyScopeManager.Reset();
ClassManager.Reset();
ClassDerivedObject.Reset();
TypeManager.Initialize();
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy