Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def _do_shutdown(self, future):
except Exception as ex:
self.call_soon_threadsafe(future.set_exception, ex)

def _check_runnung(self):
def _check_running(self):
if self.is_running():
raise RuntimeError('This event loop is already running')
if events._get_running_loop() is not None:
Expand All @@ -583,7 +583,7 @@ def _check_runnung(self):
def run_forever(self):
"""Run until stop() is called."""
self._check_closed()
self._check_runnung()
self._check_running()
self._set_coroutine_origin_tracking(self._debug)
self._thread_id = threading.get_ident()

Expand Down Expand Up @@ -615,7 +615,7 @@ def run_until_complete(self, future):
Return the Future's result, or raise its exception.
"""
self._check_closed()
self._check_runnung()
self._check_running()

new_task = not futures.isfuture(future)
future = tasks.ensure_future(future, loop=self)
Expand Down
8 changes: 6 additions & 2 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ async def coro2():
self.assertTrue(self.loop.is_running())
self.loop.run_until_complete(coro1())

self.assertRaises(
RuntimeError, self.loop.run_until_complete, coro2())
with self.assertWarnsRegex(
RuntimeWarning,
r"coroutine \S+ was never awaited"
):
self.assertRaises(
RuntimeError, self.loop.run_until_complete, coro2())

# Note: because of the default Windows timing granularity of
# 15.6 msec, we use fairly long sleep times here (~100 msec).
Expand Down