Commit b0af1ee6 authored by Denis Bilenko's avatar Denis Bilenko

on py3k 'thread' is called '_thread' and that's what we will monkey patch

parent e8d48e98
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
used directly. For spawning greenlets in your applications, prefer used directly. For spawning greenlets in your applications, prefer
:class:`Greenlet` class. :class:`Greenlet` class.
""" """
import sys
__implements__ = ['allocate_lock', __implements__ = ['allocate_lock',
'get_ident', 'get_ident',
...@@ -16,8 +17,11 @@ __implements__ = ['allocate_lock', ...@@ -16,8 +17,11 @@ __implements__ = ['allocate_lock',
'_local'] '_local']
__imports__ = ['error'] __imports__ = ['error']
if sys.version_info[0] <= 2:
__thread__ = __import__('thread') __target__ = 'thread'
else:
__target__ = '_thread'
__thread__ = __import__(__target__)
error = __thread__.error error = __thread__.error
from gevent.hub import getcurrent, GreenletExit from gevent.hub import getcurrent, GreenletExit
from gevent.greenlet import Greenlet from gevent.greenlet import Greenlet
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment