Commit 1f02e4a9 authored by Fantix King's avatar Fantix King

Handle renaming of "thread" to "_thread" in PY3

parent d48e4d86
......@@ -22,6 +22,7 @@ if sys.version_info[0] <= 2:
import thread as __thread__
else:
import _thread as __thread__
__target__ = '_thread'
error = __thread__.error
from gevent.hub import getcurrent, GreenletExit
from gevent.greenlet import Greenlet
......
......@@ -2,7 +2,10 @@ from __future__ import with_statement
import gevent
import gevent.core
import time
import thread
try:
import thread
except ImportError:
import _thread as thread
hub = gevent.get_hub()
......
......@@ -4,7 +4,10 @@ monkey.patch_all()
import time
assert 'built-in' not in repr(time.sleep), repr(time.sleep)
import thread
try:
import thread
except ImportError:
import _thread as thread
import threading
assert 'built-in' not in repr(thread.start_new_thread), repr(thread.start_new_thread)
assert 'built-in' not in repr(threading._start_new_thread), repr(threading._start_new_thread)
......
......@@ -37,7 +37,10 @@ import random
import re
import sys
import threading
import thread
try:
import thread
except ImportError:
import _thread as thread
import time
import unittest
import weakref
......
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