From c39d3bccb4c64c7f0372044153d51f045f47f9ec Mon Sep 17 00:00:00 2001 From: eirannejad Date: Fri, 5 Apr 2024 08:45:51 -0700 Subject: [PATCH] refactors --- src/runtime/McNeel.PythonEngine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/McNeel.PythonEngine.cs b/src/runtime/McNeel.PythonEngine.cs index 59cd0b181..e7690d6d7 100755 --- a/src/runtime/McNeel.PythonEngine.cs +++ b/src/runtime/McNeel.PythonEngine.cs @@ -639,7 +639,7 @@ public void RunScope( try { - pyscope.Set("__file__", pythonFile ?? string.Empty); + pyscope.Set(nameof(PyIdentifier.__file__), pythonFile ?? string.Empty); // add default references if (beforeScript is string) @@ -673,7 +673,7 @@ public void DisposeScope(object scope) PyModule PrepareScope(string scopeName, string pythonFile) { PyModule pyscope = Py.CreateScope(scopeName); - pyscope.Set("__file__", pythonFile ?? string.Empty); + pyscope.Set(nameof(PyIdentifier.__file__), pythonFile ?? string.Empty); return pyscope; }