MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / __aexit__

Method __aexit__

src/telegram/_bot.py:422–431  ·  view source on GitHub ↗

|async_context_manager| :meth:`shuts down ` the Bot.

(
        self,
        exc_type: type[BaseException] | None,
        exc_val: BaseException | None,
        exc_tb: TracebackType | None,
    )

Source from the content-addressed store, hash-verified

420 return self
421
422 async def __aexit__(
423 self,
424 exc_type: type[BaseException] | None,
425 exc_val: BaseException | None,
426 exc_tb: TracebackType | None,
427 ) -> None:
428 """|async_context_manager| :meth:`shuts down <shutdown>` the Bot."""
429 # Make sure not to return `True` so that exceptions are not suppressed
430 # https://docs.python.org/3/reference/datamodel.html?#object.__aexit__
431 await self.shutdown()
432
433 def __reduce__(self) -> NoReturn:
434 """Customizes how :func:`copy.deepcopy` processes objects of this type. Bots can not

Callers

nothing calls this directly

Calls 1

shutdownMethod · 0.95

Tested by

no test coverage detected