Fix AttributeError when webserver isn't enabled.
This commit is contained in:
parent
94376257a4
commit
ccfbe06ded
1 changed files with 5 additions and 2 deletions
|
|
@ -174,8 +174,11 @@ class Evennia(object):
|
||||||
# (see https://github.com/evennia/evennia/issues/1128)
|
# (see https://github.com/evennia/evennia/issues/1128)
|
||||||
def _wrap_sigint_handler(*args):
|
def _wrap_sigint_handler(*args):
|
||||||
from twisted.internet.defer import Deferred
|
from twisted.internet.defer import Deferred
|
||||||
d = self.web_root.empty_threadpool()
|
if WEBSERVER_ENABLED:
|
||||||
d.addCallback(lambda _: self.shutdown(_reactor_stopping=True))
|
d = self.web_root.empty_threadpool()
|
||||||
|
d.addCallback(lambda _: self.shutdown(_reactor_stopping=True))
|
||||||
|
else:
|
||||||
|
d = Deferred(lambda _: self.shutdown(_reactor_stopping=True))
|
||||||
d.addCallback(lambda _: reactor.stop())
|
d.addCallback(lambda _: reactor.stop())
|
||||||
reactor.callLater(1, d.callback, None)
|
reactor.callLater(1, d.callback, None)
|
||||||
reactor.sigInt = _wrap_sigint_handler
|
reactor.sigInt = _wrap_sigint_handler
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue