• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agronholm / anyio / 24424972435
93%

Build:
DEFAULT BRANCH: master
Ran 14 Apr 2026 10:01PM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Apr 2026 09:58PM UTC coverage: 92.756%. First build
24424972435

push

github

web-flow
fix: prevent TaskGroup re-entry with clear RuntimeError (#1110)

Entering a TaskGroup context multiple times caused an AttributeError because __aexit__ deletes self._exceptions in its finally block. On the second __aenter__, the attribute is never recreated.

Fix: check if the TaskGroup is already active in __aenter__ and raise RuntimeError instead of allowing re-entry, which would produce confusing errors. Also reinitialize _exceptions for safety.

Fixes #1109.

Signed-off-by: bahtya <bahtyar153@qq.com>

* fix: add tests and changelog for TaskGroup re-entry guard

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: add re-entry guard to trio TaskGroup backend too

Signed-off-by: bahtya <bahtyar153@qq.com>

* Apply suggestion from @agronholm

* Apply suggestion from @agronholm

* Apply review feedback: add blank line after raise in asyncio backend

* style: add blank line between changelog entries per review

Signed-off-by: bahtya <bahtyar153@qq.com>

* fix: correct re-entry test to reuse same TaskGroup

The test was creating a new TaskGroup instead of reusing the one
that was already entered, so it wasn't actually testing re-entry.

* Update src/anyio/_backends/_asyncio.py

* fix: remove duplicate raise, fix changelog author casing

* address review: remove dead code and fix test

Signed-off-by: bahtya <bahtyar153@qq.com>

* Remove TaskGroup._active flag, use _entered for lifecycle tracking

The _active flag was redundant with _entered. Since _entered now prevents
re-entry, _active is no longer needed. The spawn check in asyncio backend
uses cancel_scope._active instead.

As requested by maintainer in review comments.

Signed-off-by: bahtya <bahtyar153@qq.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: restore _active flag for trio TaskGroup spawn check

The _entered flag alone is insufficient for the trio backend's spawn
... (continued)

9 of 9 new or added lines in 2 files covered. (100.0%)

6018 of 6488 relevant lines covered (92.76%)

10.1 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24424972435.1 14 Apr 2026 10:01PM UTC 42
92.76
GitHub Action Run
Source Files on build 24424972435
  • Tree
  • List 42
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24424972435
  • 4dfe21a6 on github
  • Prev Build on master (#24406826903)
  • Next Build on master (#24454900688)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc