Commits

Denis Bilenko  committed 3ed6f10

gevent.__init__.py: properly import greenlet when it isn't from py.magic

  • Participants
  • Parent commits 2a53daf

Comments (0)

Files changed (1)

File gevent/__init__.py

 import traceback
 
 from gevent import core
-from py.magic import greenlet
+
+try:
+    from py.magic import greenlet
+    Greenlet = greenlet
+except ImportError:
+    import greenlet
+    Greenlet = greenlet.greenlet
+
+getcurrent = greenlet.getcurrent
+GreenletExit = greenlet.GreenletExit
 
 version_info = (0, 9, 0)
 __version__ = '0.9.0'