diff --git a/py/magic/greenlet.py b/py/magic/greenlet.py index 90d46b134..b35c3074a 100644 --- a/py/magic/greenlet.py +++ b/py/magic/greenlet.py @@ -2,8 +2,10 @@ import sys if '_stackless' in sys.builtin_module_names: # when running on top of a pypy with stackless support from _stackless import greenlet +elif hasattr(sys, 'pypy_objspaceclass'): + raise ImportError("Detected pypy without stackless support") else: - # regular CPython (or pypy without stackless support, and then crash :-) + # regular CPython import py gdir = py.path.local(py.__file__).dirpath() path = gdir.join('c-extension', 'greenlet', 'greenlet.c')