mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
httpserver: Don't serve_forever when documenting
1. it binds the port, which is useless while documenting 2. in some circumstances, it prevents supybot-plugin-doc from exiting (because the server threads are still running)
This commit is contained in:
parent
9869136289
commit
fd873fa0a5
@ -446,12 +446,13 @@ class RealSupyHTTPServer(HTTPServer):
|
|||||||
class TestSupyHTTPServer(RealSupyHTTPServer):
|
class TestSupyHTTPServer(RealSupyHTTPServer):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.callbacks = {}
|
self.callbacks = {}
|
||||||
|
self.server_address = ("0.0.0.0", 0)
|
||||||
def serve_forever(self, *args, **kwargs):
|
def serve_forever(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
def shutdown(self, *args, **kwargs):
|
def shutdown(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if world.testing:
|
if world.testing or world.documenting:
|
||||||
SupyHTTPServer = TestSupyHTTPServer
|
SupyHTTPServer = TestSupyHTTPServer
|
||||||
else:
|
else:
|
||||||
SupyHTTPServer = RealSupyHTTPServer
|
SupyHTTPServer = RealSupyHTTPServer
|
||||||
|
Loading…
Reference in New Issue
Block a user