← 返回首页
bpo-36375: PEP499: implementation and documentation and test updates by cameron-simpson · Pull Request #12455 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-36375: PEP499: implementation and documentation and test updates#12455

Closed
cameron-simpson wants to merge 8 commits into
python:masterfrom
cameron-simpson:PEP499-cs
Closed

bpo-36375: PEP499: implementation and documentation and test updates#12455
cameron-simpson wants to merge 8 commits into
python:masterfrom
cameron-simpson:PEP499-cs

Conversation

cameron-simpson commented Mar 20, 2019
edited by ncoghlan
Loading

Copy link
Copy Markdown

(Superseded, see #12490 instead)

This PR provides an implementation of the -m option semantics change from PEP 499. It also provides some documentation updates and 2 unit tests.

https://bugs.python.org/issue36375

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

sys.modules['__main__']?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Nice catch, fix applied, thank you! - Cameron

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

I will write isisntance()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Sounds good, applied. Thanks! - Cameron

eamanu left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Please check the travis error

eamanu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Please review the Travis errors

Copy link
Copy Markdown
Author

Please review the Travis errors

Hmm. They look related to a problem with hashlib, and not obviously my patch. Would it be sensible for me to rebase the PR on the latest master to trigger a retry? New to this process.

Copy link
Copy Markdown
Author

Please review the Travis errors

Hmm. They look related to a problem with hashlib, and not obviously my patch. Would it be sensible for me to rebase the PR on the latest master to trigger a retry? New to this process.

Trying it: rebase, see if the travis results change. If not I'll try to reproduce locally.

Copy link
Copy Markdown
Author

Please review the Travis errors
Hmm. They look related to a problem with hashlib, and not obviously my patch. Would it be sensible for me to rebase the PR on the latest master to trigger a retry? New to this process.
Trying it: rebase, see if the travis results change. If not I'll try to reproduce locally.

Well, no change. And it isn't just hashlib. Investigating further now...

cameron-simpson commented Mar 21, 2019
edited
Loading

Copy link
Copy Markdown
Author

Ok... pdb.Pdb._runmodule depends on __main__ (from "python.exe -m pdb") being a distinct module instance from sys.modules['pdb']. It doesn't actually want that, but it constructs a "bare" __main__ module by rewriting __main__.__dict__ and because that is the pdb module this wipes pdbs brain.

Investigating cleaner ways to do this. Plan A is to del sys.modules['__main__'] and make a new module for that somehow. To keep pdb's other code happy, which may presume __main__ has become the code it is debugging.

Copy link
Copy Markdown
Author

I'm withdrawing this PR, I've clearly not run the full test suite. I'll bring it back when the tests pass.

Copy link
Copy Markdown
Contributor

@cameron-simpson Ouch. You'll also need to be careful regarding the interactions with the -i switch (which drops into an interactive prompt), as that always runs the interactive session in the original __main__ (this is one of the reasons why pdb works the way it does)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.