mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-06-16 02:15:48 +00:00
Merge pull request #967 from xtfxme/python-mule-from-callable
load python mule from callable, eg. --mule=package.module:callable
This commit is contained in:
@@ -1821,6 +1821,20 @@ int uwsgi_python_mule(char *opt) {
|
||||
UWSGI_RELEASE_GIL;
|
||||
return 1;
|
||||
}
|
||||
else if (strchr(opt, ':')) {
|
||||
UWSGI_GET_GIL;
|
||||
PyObject *result = NULL;
|
||||
PyObject *arglist = Py_BuildValue("()");
|
||||
PyObject *callable = up.loaders[LOADER_MOUNT](opt);
|
||||
if (callable) {
|
||||
result = PyEval_CallObject(callable, arglist);
|
||||
}
|
||||
Py_XDECREF(result);
|
||||
Py_XDECREF(arglist);
|
||||
Py_XDECREF(callable);
|
||||
UWSGI_RELEASE_GIL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user