◐ Shell
clean mode source ↗

Change error type for bad objects in "with" and "async with" by dalinaum · Pull Request #4656 · RustPython/RustPython

Conversation

@dalinaum

This patch does not cover all cases of test_contextlib.py

bytecode::Instruction::SetupWith and BeforeAsyncWith raise a TypeError instead of an AttributeError.

It relates to #4650

dalinaum

youknowone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextlib seemed to related to contextlib.py version.
so this patch is fully fixing the with changes in 3.11. right?

@dalinaum

@youknowone I'm going to replace contextlib.py and test again.

This patch does not cover all cases of `test_contextlib.py`

`bytecode::Instruction::SetupWith` and `BeforeAsyncWith`
raise a TypeError instead of an AttributeError.

Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>

@dalinaum

@youknowone #4659 fixed 3 tests in text_conextlib.py and this patch fixed 2 tests.

However, there are still expectedFailures that were added during updating test_contextlib.py and contextlib.py.

@youknowone

at least, they are not regressions ;)

@youknowone

Thank you for contributing!

2 participants

@dalinaum @youknowone