Files
pytest2/py/magic/greenlet.py
hpk 499d60c8ab [svn r38203] rename getpymodule/getpycodeobj to "_" methods
(which can build C modules on the fly)
it's not clear they are still useful this way
and they are easy to confuse with pyimport()

--HG--
branch : trunk
2007-02-08 20:48:31 +01:00

11 lines
404 B
Python

import sys
if '_stackless' in sys.builtin_module_names:
# when running on top of a pypy with stackless support
from _stackless import greenlet
else:
# regular CPython (or pypy without stackless support, and then crash :-)
import py
gdir = py.path.local(py.__file__).dirpath()
path = gdir.join('c-extension', 'greenlet', 'greenlet.c')
greenlet = path._getpymodule().greenlet