Fixing ftplib test failures.

This commit is contained in:
Ryan Williams
2010-07-29 12:18:28 -07:00
parent 27ff9d1bba
commit 7e91a215dd
2 changed files with 5 additions and 4 deletions

View File

@@ -9,9 +9,11 @@ debug.hub_prevent_multiple_readers(False)
def restart_hub():
from eventlet import hubs
hub = hubs.get_hub()
hub.abort()
hub_shortname = hub.__module__.split('.')[-1]
hubs.use_hub(hub_shortname)
# don't restart the pyevent hub; it's not necessary
if hub_shortname != 'pyevent':
hub.abort()
hubs.use_hub(hub_shortname)
def assimilate_patched(name):
try:

View File

@@ -4,8 +4,7 @@ from eventlet.green import ftplib
from eventlet.green import threading
from eventlet.green import socket
patcher.inject('test.test_ftplib',
globals())
patcher.inject('test.test_ftplib', globals())
if __name__ == "__main__":
test_main()