Skip to content
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

bpo-40173: Remove redundant import module of import_fresh_module() #19390

Closed
wants to merge 1 commit into from

Conversation

shihai1991
Copy link
Member

@shihai1991 shihai1991 commented Apr 6, 2020

@shihai1991 shihai1991 changed the title WIP: Remove redundant import module of import_fresh_module() bpo-40173: Remove redundant import module of import_fresh_module() Apr 6, 2020
Copy link
Member

@iritkatriel iritkatriel left a comment

This PR needs a unit test.

@shihai1991
Copy link
Member Author

shihai1991 commented Aug 24, 2020

This PR needs a unit test.

Thanks for your comment. I have forget this PR's detail. test.support need many test cases.
After we make sure this PR can fix the issue, I can add some test cases.

@iritkatriel
Copy link
Member

iritkatriel commented Aug 24, 2020

Up to you, but I think it will be easier for reviewers to see what issue the PR is trying to fix if it included tests.

sys.modules.clear()
sys.modules.update(orig_modules)
Copy link
Member

@serhiy-storchaka serhiy-storchaka Sep 30, 2021

Choose a reason for hiding this comment

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

I considered this option, but some modules can not support re-importing. So it is safer to restore only explicitly mentioned modules and their submodules.
See #28654.

Copy link
Member Author

@shihai1991 shihai1991 Oct 6, 2021

Choose a reason for hiding this comment

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

Oh, sorry, Serhiy. I missed your PR :(

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

Successfully merging this pull request may close these issues.

None yet

5 participants