# HG changeset patch # User Matt Johnston # Date 1430232250 -28800 # Node ID 815f811f6a65d6a403a5d18c3337532d94dbdea7 # Parent 9b1d71310c831464f057a17b138be325427d7597 Fixed some warnings diff -r 9b1d71310c83 -r 815f811f6a65 py/tempserver.py --- a/py/tempserver.py Sat Apr 11 23:32:59 2015 +0800 +++ b/py/tempserver.py Tue Apr 28 22:44:10 2015 +0800 @@ -48,21 +48,19 @@ # XXX do these go here or in __enter_() ? self.start_time = self.now() - tasks = ( + runloops = [ self.fridge.run(), self.sensors.run(), self.uploader.run(), - ) + ] loop = asyncio.get_event_loop() try: - result_tasks = loop.run_until_complete(asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION)) - # use the results so that exceptions get thrown - [t.result() for x in result_tasks for t in x] + loop.run_until_complete(asyncio.gather(*runloops)) except KeyboardInterrupt: - print('ctrl-c') - pass + print('\nctrl-c') finally: + # loop.close() seems necessary otherwise get warnings about signal handlers loop.close() def now(self): @@ -110,7 +108,7 @@ yield from asyncio.wait_for(self._wakeup.wait(), timeout=timeout) except asyncio.TimeoutError: pass - + def _reload_signal(self): try: self.params.load()