Skip to content

Change error type for bad objects in "with" and "async with" #4656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Change error type for bad objects in "with" and "async with" #4656

merged 1 commit into from
Mar 7, 2023

Conversation

dalinaum
Copy link
Contributor

@dalinaum dalinaum commented Mar 7, 2023

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

Copy link
Member

@youknowone youknowone left a comment

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
Copy link
Contributor Author

dalinaum commented Mar 7, 2023

@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
Copy link
Contributor Author

dalinaum commented Mar 7, 2023

@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
Copy link
Member

at least, they are not regressions ;)

@youknowone youknowone merged commit bdce56d into RustPython:main Mar 7, 2023
@youknowone
Copy link
Member

Thank you for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants