summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-09-21 20:28:17 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-09-29 00:07:27 +0200
commitb6953d3fcfcb0f1aa931cc58291febf776bdae0b (patch)
tree619ffefc429919140f3ce3539d57cdc2fb0594a2 /src
parent1390c87c05afabd9b64bbc825adde081423f046d (diff)
downloadpoezio-b6953d3fcfcb0f1aa931cc58291febf776bdae0b.tar.gz
poezio-b6953d3fcfcb0f1aa931cc58291febf776bdae0b.tar.bz2
poezio-b6953d3fcfcb0f1aa931cc58291febf776bdae0b.tar.xz
poezio-b6953d3fcfcb0f1aa931cc58291febf776bdae0b.zip
Get the asyncio event loop only once.
Diffstat (limited to 'src')
-rw-r--r--src/poezio.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 68acae10..6a4a0b77 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -61,11 +61,12 @@ def main():
# the asyncio logger will not follow our configuration and won't write
# the tracebacks in the correct file, etc
import asyncio
+ loop = asyncio.get_event_loop()
- asyncio.get_event_loop().add_reader(sys.stdin, cocore.on_input_readable)
- asyncio.get_event_loop().add_signal_handler(signal.SIGWINCH, cocore.sigwinch_handler)
+ loop.add_reader(sys.stdin, cocore.on_input_readable)
+ loop.add_signal_handler(signal.SIGWINCH, cocore.sigwinch_handler)
cocore.xmpp.start()
- asyncio.get_event_loop().run_forever()
+ loop.run_forever()
# We reach this point only when loop.stop() is called
try:
cocore.reset_curses()