bpo-36375: PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules by cameron-simpson · Pull Request #12490 · python/cpython
…tinct new __main__ module With PEP499 __main__ is aliased as the canonical name of the -m module. When pdb is invoked via "python -m pdb" it can no longer rewrite the symbol table of the existing __main__ module because that is pdb itself. Instead we construct a new module and insert it as sys.modules['__main__'].
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