diff --git a/hello_world.py b/hello_world.py index a5119194..5f6776a2 100644 --- a/hello_world.py +++ b/hello_world.py @@ -4,7 +4,10 @@ if uwsgi.loop == 'gevent': print uwsgi.version print uwsgi.workers() -uwsgi.cache_set('foo', "Hello World from cache") +try: + uwsgi.cache_set('foo', "Hello World from cache") +except: + pass def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) yield "foobar
" @@ -12,4 +15,7 @@ def application(env, start_response): gevent.sleep(10) yield str(env['wsgi.input'].fileno()) yield "

Hello World

" - yield uwsgi.cache_get('foo') + try: + yield uwsgi.cache_get('foo') + except: + pass diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 503578eb..2461d6fc 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -661,6 +661,9 @@ void init_uwsgi_embedded_module() { exit(1); } } + else { + PyDict_SetItemString(up.embedded_dict, "loop", Py_None); + } PyObject *py_opt_dict = PyDict_New(); for (i = 0; i < uwsgi.exported_opts_cnt; i++) {