fix pypy when no app is loaded

This commit is contained in:
roberto@mrspurr
2012-03-31 18:06:03 +02:00
parent c2df8a099e
commit a864c8d6ed
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -246,6 +246,10 @@ void uwsgi_python_reset_random_seed() {
random_seed = PyDict_GetItemString(random_dict, "seed");
if (random_seed) {
PyObject *random_args = PyTuple_New(1);
Py_INCREF(random_args);
#ifdef UWSGI_PYPY
Py_INCREF(Py_None);
#endif
// pass no args
PyTuple_SetItem(random_args, 0, Py_None);
PyEval_CallObject(random_seed, random_args);