Skip to content

Minor code improvement #4828

Closed as not planned
Closed as not planned
💡 feature
@david-shiko

Description

@david-shiko

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

https://github.com/python-telegram-bot/python-telegram-bot/blob/fc3863ac9a86d8ed5bd8307badac142aebf59a87/telegram/ext/_application.py#L540C9-L540C34

        await self.bot.shutdown()
        await self._update_processor.shutdown()

        if self.updater:
            await self.updater.shutdown()

await self.bot.shutdown() already called inside the await self.updater.shutdown()

Describe the solution you'd like

        if self.updater:
            await self.updater.shutdown()
        else:
            await self.bot.shutdown()
        await self._update_processor.shutdown()  # Not sure when this should be called exactly

From the code is a little uncleare does await self._update_processor.shutdown() should be called before or after await self.updater.shutdown()

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions