Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python doesn't have an obvious way to reveal the original command and module name, so we check the __main__ module for __package__ and infer it's a module running as a script unless the value is None, which implies a file path was provided modules running as scripts are invoked with -m flags packages running with scripts have base filename __main__.py from this we recreate an invocation
- Loading branch information