Fixed the non-quitting bug, although it's not been tested with twistedDrivers itself. It works with the other two.

This commit is contained in:
Jeremy Fincher 2004-04-07 15:52:28 +00:00
parent 9cfed8f0d3
commit c97d3905c5
2 changed files with 8 additions and 8 deletions

View File

@ -75,14 +75,9 @@ def main():
drivers.run()
except KeyboardInterrupt:
log.info('Exiting due to Ctrl-C.')
now = time.time()
seconds = now - world.startedAt
log.info('Total uptime: %s.', utils.timeElapsed(seconds))
(user, system, _, _, _) = os.times()
log.info('Total CPU time taken: %s seconds.', user+system)
raise SystemExit
break
except SystemExit:
raise
break
except:
try: # Ok, now we're *REALLY* paranoid!
log.exception('Exception raised out of drivers.run:')
@ -96,6 +91,11 @@ def main():
print 'raise an exception, but freaking-a, it was a string'
print 'exception. People who raise string exceptions should'
print 'die a slow, painful death.'
now = time.time()
seconds = now - world.startedAt
log.info('Total uptime: %s.', utils.timeElapsed(seconds))
(user, system, _, _, _) = os.times()
log.info('Total CPU time taken: %s seconds.', user+system)
log.info('No more Irc objects, exiting.')
if __name__ == '__main__':

View File

@ -384,7 +384,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
Exits the bot.
"""
raise SystemExit, 'Quitting because I was told by %s' % msg.prefix
world.ircs[:] = []
def flush(self, irc, msg, args):
"""takes no arguments