Skip to content

fix: drop the self-assignment at the top of ContextInstanceMixin.get_current - #1895

Open
darkdi wants to merge 2 commits into
aiogram:dev-3.xfrom
darkdi:fix/context-instance-self-assignment
Open

fix: drop the self-assignment at the top of ContextInstanceMixin.get_current#1895
darkdi wants to merge 2 commits into
aiogram:dev-3.xfrom
darkdi:fix/context-instance-self-assignment

Conversation

@darkdi

@darkdi darkdi commented Sep 2, 2026

Copy link
Copy Markdown

get_current opens with cls.__context_instance = cls.__context_instance. __init_subclass__ already sets that attribute on every subclass, so the read and the write hit the same entry in the class dict and the line is a no-op. It reads as if it were priming something, which is what sent me looking.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

❌ Changelog is required!

You need to add a brief description of the changes to the CHANGES directory.

Changes file should be named like <issue or PR number>.<category>.rst,
example 1234.bugfix.rst where 1234 is the PR or issue number and bugfix is the category.

The content of the file should be a brief description of the changes in
the PR in the format of a description of what has been done.

Possible categories are: feature, bugfix, doc, removal and misc.

@github-actions github-actions Bot added the 3.x Issue or PR for stable 3.x version label Sep 2, 2026
@darkdi

darkdi commented Sep 2, 2026

Copy link
Copy Markdown
Author

Fragment is in as CHANGES/1895.misc.rst, but changes-required looks like it cannot go green on any fork PR at the moment: actions/checkout refuses to check out fork code under pull_request_target unless the step sets allow-unsafe-pr-checkout: true, so the job dies before towncrier runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Issue or PR for stable 3.x version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant