mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-11-21 02:44:32 +00:00
fixed python3 reload-on-exception
This commit is contained in:
@@ -10,12 +10,16 @@ int manage_python_response(struct wsgi_request *wsgi_req) {
|
||||
|
||||
char *uwsgi_python_get_exception_type(PyObject *exc) {
|
||||
char *class_name = NULL;
|
||||
#ifndef PYTHREE
|
||||
if (PyClass_Check(exc)) {
|
||||
class_name = PyString_AsString( ((PyClassObject*)(exc))->cl_name );
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
class_name = (char *) ((PyTypeObject*)exc)->tp_name;
|
||||
#ifndef PYTHREE
|
||||
}
|
||||
#endif
|
||||
|
||||
if (class_name) {
|
||||
char *dot = strrchr(class_name, '.');
|
||||
|
||||
@@ -261,9 +261,9 @@ static struct uwsgi_option uwsgi_base_options[] = {
|
||||
{"ignore-script-name", no_argument, 0, "ignore SCRIPT_NAME", uwsgi_opt_true, &uwsgi.ignore_script_name, 0},
|
||||
{"catch-exceptions", no_argument, 0, "report exception has http output (discouraged)", uwsgi_opt_true, &uwsgi.catch_exceptions, 0},
|
||||
{"reload-on-exception", no_argument, 0, "reload a worker when an exception is raised", uwsgi_opt_true, &uwsgi.reload_on_exception, 0},
|
||||
{"reload-on-exception-type", no_argument, 0, "reload a worker when a specific exception type is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_type, 0},
|
||||
{"reload-on-exception-value", no_argument, 0, "reload a worker when a specific exception value is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_value, 0},
|
||||
{"reload-on-exception-repr", no_argument, 0, "reload a worker when a specific exception type+value (language-specific) is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_repr, 0},
|
||||
{"reload-on-exception-type", required_argument, 0, "reload a worker when a specific exception type is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_type, 0},
|
||||
{"reload-on-exception-value", required_argument, 0, "reload a worker when a specific exception value is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_value, 0},
|
||||
{"reload-on-exception-repr", required_argument, 0, "reload a worker when a specific exception type+value (language-specific) is raised", uwsgi_opt_add_string_list, &uwsgi.reload_on_exception_repr, 0},
|
||||
#ifdef UWSGI_UDP
|
||||
{"udp", required_argument, 0, "run the udp server on the specified address", uwsgi_opt_set_str, &uwsgi.udp_socket, UWSGI_OPT_MASTER},
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user