Lines Matching full:__main__
144 if mod_name == "__main__" or mod_name.endswith(".__main__"):
145 raise error("Cannot use package as __main__ module")
147 pkg_main_name = mod_name + ".__main__"
174 """Runs the designated module in the __main__ namespace
177 __main__ namespace. If this is not desirable, the run_module()
180 At the very least, these variables in __main__ will be overwritten:
188 if alter_argv or mod_name != "__main__": # i.e. -m switch
195 main_globals = sys.modules["__main__"].__dict__
199 "__main__", mod_spec)
212 otherwise, __name__ will be set to mod_name + '__main__' if the
233 # execute a zipfile or directory by invoking __main__.py
234 # Also moves the standard __main__ out of the way so that the
236 main_name = "__main__"
266 or directory containing a top level __main__.py script.
299 # existing __main__ module may prevent location of the new module.
313 if __name__ == "__main__":