suppress a uvloop specific not implemented error
@@ -30,6 +30,7 @@ __all__: typing.List[str] = ["BotApp", "LoggerLevelT"]
import asyncio
import concurrent.futures
+import contextlib
import datetime
import logging
import math
@@ -994,6 +995,9 @@ class BotApp(traits.BotAware, event_dispatcher.EventDispatcher):
if sys.version_info >= (3, 9):
_LOGGER.debug("shutting down default executor")
loop.run_until_complete(loop.shutdown_default_executor())
+ with contextlib.suppress(NotImplementedError):
+ # This seems to raise a NotImplementedError when running with uvloop.
+ loop.run_until_complete(loop.shutdown_default_executor())
_LOGGER.debug("shutting down asyncgens")
loop.run_until_complete(loop.shutdown_asyncgens())
