]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128398: improve error messages when incorrectly using `with` and `async with`...
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sat, 19 Apr 2025 08:44:01 +0000 (10:44 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 08:44:01 +0000 (10:44 +0200)
commit8a9c6c4d16a746eea1e000d6701d1c274c1f331b
treec7898c8103a3f99297f07151cc3dbf5e5572dfb2
parent95800fe6e719c829acf52fbb00198135b78719b4
gh-128398: improve error messages when incorrectly using `with` and `async with` (#132218)

Improve the error message with a suggestion when an object supporting the synchronous
(resp. asynchronous) context manager protocol is entered using `async with` (resp. `with`)
instead of `with` (resp. `async with`).
Doc/whatsnew/3.14.rst
Include/internal/pycore_ceval.h
Lib/test/test_with.py
Lib/unittest/async_case.py
Lib/unittest/case.py
Misc/NEWS.d/next/Core_and_Builtins/2025-04-07-13-46-57.gh-issue-128398.gJ2zIF.rst [new file with mode: 0644]
Python/bytecodes.c
Python/ceval.c
Python/executor_cases.c.h
Python/generated_cases.c.h