From 8a287e6e7397c61fc0c5086b175c7968c3762f40 Mon Sep 17 00:00:00 2001 From: Falldog Date: Sat, 13 Jul 2019 13:42:34 +0800 Subject: [PATCH] Fix threading globals variables issue #60 #61 --- src/pyconcrete_exe/pyconcrete_exe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pyconcrete_exe/pyconcrete_exe.c b/src/pyconcrete_exe/pyconcrete_exe.c index 09a7247..408c83e 100644 --- a/src/pyconcrete_exe/pyconcrete_exe.c +++ b/src/pyconcrete_exe/pyconcrete_exe.c @@ -70,7 +70,6 @@ void execPycContent(PyObject* pyc_content) PyObject* pyc_content_wo_magic = NULL; PyObject* py_code = NULL; PyObject* global = PyDict_New(); - PyObject* local = PyDict_New(); Py_ssize_t content_size = 0; char* content = NULL; #if PY_MAJOR_VERSION >= 3 @@ -97,12 +96,11 @@ void execPycContent(PyObject* pyc_content) // setup global and exec loaded py_code PyDict_SetItemString(global, "__name__", main_name); PyDict_SetItemString(global, "__builtins__", PyEval_GetBuiltins()); - PyEval_EvalCode((PyCodeObject*)py_code, global, local); + PyEval_EvalCode((PyCodeObject*)py_code, global, global); ERROR: Py_XDECREF(py_code); Py_XDECREF(global); - Py_XDECREF(local); Py_XDECREF(pyc_content_wo_magic); Py_XDECREF(py_marshal_loads); Py_XDECREF(py_marshal);