Fix exception when stopping the HTTP server if already stopped.

This commit is contained in:
Valentin Lorentz 2011-06-25 10:02:30 +02:00
parent ff2047997a
commit fa3fc7d20a

View File

@ -180,9 +180,10 @@ def stopServer():
"""Stops the HTTP server. Should be run only from this module or from
when the bot is dying (ie. from supybot.world)"""
global httpServer
log.info('Stopping HTTP server.')
httpServer.shutdown()
httpServer = None
if httpServer is not None:
log.info('Stopping HTTP server.')
httpServer.shutdown()
httpServer = None
if configGroup.keepAlive():
startServer()