Conversation
…ain__ module is set to the entry point module
|
Fair point about code expecting the existing behavior of |
|
It will essentially be inlining the Calling the internal methods of runpy isn't ideal. |
|
Definitely agree that depending on runpy internals isn't great. Before we go down too much into thinking how to implement this, I'd like to make a case that leaving From reading https://www.python.org/dev/peps/pep-0338/ , it looks like the argument for changing If the above argument makes sense, and others agree with it, the right thing to do here would probably be to propose changing runpy for python 3.6+. Assuming that's accepted, we can backport the functionality with the "hack" you posted for < 3.6. I'll send an mail to python-dev to see how folks feel about this. |
|
Yeah totally agree |

Specify
alter_sys=Truewhen invokingrunpy.run_moduleso that__main__points to the entry point module.Fixes #210