diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index a885065..a2a8cb6 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -609,16 +609,14 @@ class BaseEventLoop(events.AbstractEventLoop): else: timeout = min(timeout, deadline) - # TODO: Instrumentation only in debug mode? t0 = self.time() event_list = self._selector.select(timeout) t1 = self.time() - argstr = '' if timeout is None else ' {:.3f}'.format(timeout) - if t1-t0 >= 1: + if t1 - t0 >= 1: + argstr = '' if timeout is None else ' {:.3f}'.format(timeout) level = logging.INFO - else: - level = logging.DEBUG - logger.log(level, 'poll%s took %.3f seconds', argstr, t1-t0) + logger.log(level, 'poll%s took %.3f seconds', argstr, t1-t0) + self._process_events(event_list) # Handle 'later' callbacks that are ready. diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 96f2975..18fd655 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -207,12 +207,6 @@ class BaseEventLoopTests(unittest.TestCase): self.loop._run_once() self.assertEqual(logging.INFO, m_logging.log.call_args[0][0]) - idx = -1 - data = [10.0, 10.0, 10.3, 13.0] - self.loop._scheduled = [events.TimerHandle(11.0, lambda:True, ())] - self.loop._run_once() - self.assertEqual(logging.DEBUG, m_logging.log.call_args[0][0]) - def test__run_once_schedule_handle(self): handle = None processed = False