Fixed second-thread importing of select module. Also slight patcher fix.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import select
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
_threadlocal = threading.local()
|
_threadlocal = threading.local()
|
||||||
@@ -29,7 +30,6 @@ def get_default_hub():
|
|||||||
import eventlet.hubs.epolls
|
import eventlet.hubs.epolls
|
||||||
return eventlet.hubs.epolls
|
return eventlet.hubs.epolls
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import select
|
|
||||||
if hasattr(select, 'poll'):
|
if hasattr(select, 'poll'):
|
||||||
import eventlet.hubs.poll
|
import eventlet.hubs.poll
|
||||||
return eventlet.hubs.poll
|
return eventlet.hubs.poll
|
||||||
|
@@ -60,5 +60,7 @@ def patch_function(func, *additional_modules):
|
|||||||
for name, mod in additional_modules:
|
for name, mod in additional_modules:
|
||||||
if saved[name] is not None:
|
if saved[name] is not None:
|
||||||
sys.modules[name] = saved[name]
|
sys.modules[name] = saved[name]
|
||||||
|
else:
|
||||||
|
del sys.modules[name]
|
||||||
return patched
|
return patched
|
||||||
|
|
Reference in New Issue
Block a user