diff --git a/eventlet/hubs/__init__.py b/eventlet/hubs/__init__.py index b637eab..d57f66c 100644 --- a/eventlet/hubs/__init__.py +++ b/eventlet/hubs/__init__.py @@ -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 diff --git a/eventlet/patcher.py b/eventlet/patcher.py index e10ac4f..66f9d4c 100644 --- a/eventlet/patcher.py +++ b/eventlet/patcher.py @@ -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 \ No newline at end of file