django__django-14311
Allow autoreloading of `python -m custom_module runserver`
Verdict: the fix is stated in the issue (Tier A).
The one change I'd make is that I'd change modspec.name.split(".")[-1] == "__main__" to modspec.name == "__main__" or modspec.name.endswith(".__main__") to avoid dumb corner cases like a module named foo.my__main__ (which is how runpy.py itself deals with it).
The text states the fix: “The one change I'd make is that I'd change modspec.name.split(".")[-1] == "__main__" to modspec.name == "__main__" or modspec.name.endswith(".__main__") to avoid dumb co…”
All SWE-bench Verified tasks · more django/django tasks · How the check works