From 1ae05a9ebc6ff3d9efd83ec081c82bb7d613491e Mon Sep 17 00:00:00 2001 From: Unbit Date: Thu, 23 May 2013 12:02:35 +0200 Subject: [PATCH] avoid loading pypy when python is already loaded --- plugins/pypy/pypy_plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/pypy/pypy_plugin.c b/plugins/pypy/pypy_plugin.c index 4ccf6d8e..b5352a83 100644 --- a/plugins/pypy/pypy_plugin.c +++ b/plugins/pypy/pypy_plugin.c @@ -71,6 +71,12 @@ static int uwsgi_pypy_init() { size_t rlen = 0; char *buffer = NULL; + void *is_cpython_loaded = dlsym(RTLD_DEFAULT, "Py_Initialize"); + if (is_cpython_loaded) { + uwsgi_log("!! Loading both PyPy and CPython in the same process IS PURE EVIL AND IT IS NOT SUPPORTED !!!\n"); + exit(1); + } + if (upypy.lib) { upypy.handler = dlopen(upypy.lib, RTLD_NOW | RTLD_GLOBAL); }