Skip to content

bpo-31676: Fix test_imp.test_load_source() side effect#3871

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:test_imp
Oct 13, 2017
Merged

bpo-31676: Fix test_imp.test_load_source() side effect#3871
vstinner merged 1 commit into
python:masterfrom
vstinner:test_imp

Conversation

@vstinner

@vstinner vstinner commented Oct 3, 2017

Copy link
Copy Markdown
Member

test_load_source() now replaces the current __name__ module with a
temporary module to prevent side effects.

https://bugs.python.org/issue31676

Comment thread Lib/test/test_imp.py Outdated

@serhiy-storchaka serhiy-storchaka Oct 4, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't be safe to not use the name of an existing module?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

test_load_source() now replaces the current __name__ module with a
temporary module to prevent side effects.
@vstinner vstinner changed the title [WIP] bpo-31676: Fix test_imp.test_load_source() side effect bpo-31676: Fix test_imp.test_load_source() side effect Oct 9, 2017
@vstinner vstinner merged commit a505ecd into python:master Oct 13, 2017
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @Haypo for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@vstinner vstinner deleted the test_imp branch October 13, 2017 20:48
@bedevere-bot

Copy link
Copy Markdown

GH-3988 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 13, 2017
…H-3871)

test_load_source() now replaces the current __name__ module with a
temporary module to prevent side effects.
(cherry picked from commit a505ecd)
Mariatta pushed a commit that referenced this pull request Oct 18, 2017
…3988)

test_load_source() now replaces the current __name__ module with a
temporary module to prevent side effects.
(cherry picked from commit a505ecd)
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.

5 participants