Changeset 1869
- Timestamp:
- 01/18/08 18:00:02
- Files:
-
- trunk/cherrypy/restsrv/wspbus.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/restsrv/wspbus.py
r1831 r1869 61 61 """ 62 62 63 import atexit 63 64 import os 64 65 try: … … 70 71 import time 71 72 import traceback as _traceback 73 import warnings 72 74 73 75 … … 159 161 return output 160 162 163 def _clean_exit(self): 164 """An atexit handler which asserts the Bus is not running.""" 165 if self.state != states.EXITING: 166 warnings.warn( 167 "The main thread is exiting, but the Bus is in the %r state; " 168 "shutting it down automatically now. You must either call " 169 "bus.block() after start(), or call bus.exit() before the " 170 "main thread exits." % self.state, RuntimeWarning) 171 self.exit() 172 161 173 def start(self): 162 174 """Start all services.""" 175 atexit.register(self._clean_exit) 176 163 177 self.state = states.STARTING 164 178 self.log('Bus STARTING')

