From 09f01ad0c5bed7d6eea1141899113fd6f69eb085 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 27 Sep 2018 11:33:25 +0300 Subject: [PATCH] Issue #2646: Replace when delete parameter from partset does not work for part. --- src/InitializationPlugin/InitializationPlugin_PyInterp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp index b7d591b29..3d9f7e8e7 100644 --- a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp +++ b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp @@ -63,8 +63,7 @@ InitializationPlugin_PyInterp::positions(const std::string& theExpression, // prepare a context PyObject* aContext = PyDict_New(); - PyObject* aBuiltinModule = PyImport_AddModule("__builtin__"); - PyDict_SetItemString(aContext, "__builtins__", aBuiltinModule); + PyDict_SetItemString(aContext, "__builtins__", PyEval_GetBuiltins()); std::string anExpression = adjustExpression(theExpression); // extend aContext with variables -- 2.39.2