From e1d1b928117d17bba274f4c7923523101bdf1321 Mon Sep 17 00:00:00 2001 From: Cesare Montresor Date: Fri, 29 Dec 2023 21:07:52 +0100 Subject: [PATCH] - set runtime non static, issues with editor output --- Razor/RazorEnhanced/PythonEngine.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Razor/RazorEnhanced/PythonEngine.cs b/Razor/RazorEnhanced/PythonEngine.cs index 1a28e0e9..67525440 100644 --- a/Razor/RazorEnhanced/PythonEngine.cs +++ b/Razor/RazorEnhanced/PythonEngine.cs @@ -20,7 +20,7 @@ public class PythonEngine public Dictionary Modules; - public static ScriptRuntime Runtime; + public ScriptRuntime Runtime; public ScriptEngine Engine { get; } public ScriptScope Scope { get; set; } public String Text { get; set; } @@ -32,9 +32,7 @@ public class PythonEngine public PythonEngine() { - if (Runtime == null) { - Runtime = IronPython.Hosting.Python.CreateRuntime(); - } + Runtime = IronPython.Hosting.Python.CreateRuntime(); Engine = IronPython.Hosting.Python.GetEngine(Runtime); //Paths for IronPython 3.4