2007-01-24 22:24:01 +08:00
|
|
|
import sys
|
|
|
|
if '_stackless' in sys.builtin_module_names:
|
|
|
|
# when running on top of a pypy with stackless support
|
|
|
|
from _stackless import greenlet
|
2007-07-24 17:06:42 +08:00
|
|
|
elif hasattr(sys, 'pypy_objspaceclass'):
|
|
|
|
raise ImportError("Detected pypy without stackless support")
|
2007-01-24 22:24:01 +08:00
|
|
|
else:
|
2007-07-24 17:06:42 +08:00
|
|
|
# regular CPython
|
2007-01-24 22:24:01 +08:00
|
|
|
import py
|
|
|
|
gdir = py.path.local(py.__file__).dirpath()
|
|
|
|
path = gdir.join('c-extension', 'greenlet', 'greenlet.c')
|
2007-02-09 03:48:31 +08:00
|
|
|
greenlet = path._getpymodule().greenlet
|