Fixed second-thread importing of select module. Also slight patcher fix.

This commit is contained in:
Ryan Williams
2010-01-08 20:03:50 -08:00
parent 9ec729c023
commit b3e52409ab
2 changed files with 3 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import select
import sys
import threading
_threadlocal = threading.local()
@@ -29,7 +30,6 @@ def get_default_hub():
import eventlet.hubs.epolls
return eventlet.hubs.epolls
except ImportError:
import select
if hasattr(select, 'poll'):
import eventlet.hubs.poll
return eventlet.hubs.poll

View File

@@ -60,5 +60,7 @@ def patch_function(func, *additional_modules):
for name, mod in additional_modules:
if saved[name] is not None:
sys.modules[name] = saved[name]
else:
del sys.modules[name]
return patched