Skip to content

Commit

Permalink
Fix threading globals variables issue #60 #61
Browse files Browse the repository at this point in the history
  • Loading branch information
Falldog committed Jul 13, 2019
1 parent ab380b5 commit 8a287e6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pyconcrete_exe/pyconcrete_exe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 8a287e6

Please sign in to comment.