From a14b0c957473f8c2c88b8ae95e4e4eba8a3c3c21 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 11 Mar 2020 10:06:53 +0100 Subject: [PATCH] details --- matrix_webhook.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/matrix_webhook.py b/matrix_webhook.py index 67b60b2..041bb33 100755 --- a/matrix_webhook.py +++ b/matrix_webhook.py @@ -73,11 +73,11 @@ async def main(event): def terminate(event, signal): """Close handling stuff.""" event.set() - loop = asyncio.get_event_loop() - loop.remove_signal_handler(signal) + asyncio.get_event_loop().remove_signal_handler(signal) -if __name__ == '__main__': +def run(): + """Launch everything.""" loop = asyncio.get_event_loop() event = asyncio.Event() @@ -87,3 +87,7 @@ if __name__ == '__main__': loop.run_until_complete(main(event)) loop.close() + + +if __name__ == '__main__': + run()