Skip to content

Instantly share code, notes, and snippets.

@bhavishyagopesh
Created July 21, 2017 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhavishyagopesh/91017a33b93a92a7269dd6838e186672 to your computer and use it in GitHub Desktop.
Save bhavishyagopesh/91017a33b93a92a7269dd6838e186672 to your computer and use it in GitHub Desktop.
run_mod definition
static PyObject *
run_mod(mod_ty mod, const char *filename, PyObject *globals, PyObject *locals,
PyCompilerFlags *flags, PyArena *arena)
{
PyCodeObject *co;
PyObject *v;
co = PyAST_Compile(mod, filename, flags, arena);
if (co == NULL)
return NULL;
v = PyEval_EvalCode(co, globals, locals);
Py_DECREF(co);
return v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment