manage.py does not find custom commands if only .pyc file exists
|Reported by:||pressureman||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
django.core.management.find_commands() is written such that it only looks for .py files in the custom command directories. This fails if, for example, a project has been byte-compiled (eg. with compileall) and the original source .py files removed.
The attached patch will find .pyc and .pyo files as well (whilst still returning a list of unique commands).