Allow running the tests when twisted is not installed.

This commit is contained in:
donovan
2009-03-28 14:12:08 -05:00
parent e50f968845
commit 91e2ffbcc6

View File

@@ -63,7 +63,10 @@ def enum_hubs():
return result
def enum_reactors():
import twisted
try:
import twisted
except ImportError:
return []
p = os.path.join(os.path.dirname(twisted.__file__), 'internet', '*?reactor.py')
files = glob(p)
all_reactors = [os.path.basename(f[:-3]) for f in files]