Sorry, something went wrong.
There was a problem hiding this comment.
sys.modules['__main__']?
Sorry, something went wrong.
There was a problem hiding this comment.
Nice catch, fix applied, thank you! - Cameron
Sorry, something went wrong.
There was a problem hiding this comment.
I will write isisntance()
Sorry, something went wrong.
There was a problem hiding this comment.
Sounds good, applied. Thanks! - Cameron
Sorry, something went wrong.
There was a problem hiding this comment.
Please check the travis error
Sorry, something went wrong.
There was a problem hiding this comment.
Please review the Travis errors
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
Please review the Travis errors Well, no change. And it isn't just hashlib. Investigating further now... |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
I'm withdrawing this PR, I've clearly not run the full test suite. I'll bring it back when the tests pass. |
Sorry, something went wrong.
|
@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) |
Sorry, something went wrong.
(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