better error message in twisted hub

This commit is contained in:
Denis Bilenko
2008-12-11 14:02:14 +06:00
parent ce64266276
commit 5b972a0447

View File

@@ -235,7 +235,7 @@ class TwistedHub(BaseTwistedHub):
installSignalHandlers = False installSignalHandlers = False
def __init__(self): def __init__(self):
assert Hub.state==0, ('This hub can only be instantiated once', Hub.state) assert Hub.state==0, ('%s hub can only be instantiated once' % type(self).__name__, Hub.state)
Hub.state = 1 Hub.state = 1
make_twisted_threadpool_daemonic() # otherwise the program would hang after the main greenlet exited make_twisted_threadpool_daemonic() # otherwise the program would hang after the main greenlet exited
g = greenlet(self.run) g = greenlet(self.run)