Ticket #12206: 12206.diff

File 12206.diff, 679 bytes (added by wenjoseph, 15 years ago)

Search for .py, .pyc and .pyo

  • django/core/management/__init__.py

     
    2323    """
    2424    command_dir = os.path.join(management_dir, 'commands')
    2525    try:
    26         return [f[:-3] for f in os.listdir(command_dir)
    27                 if not f.startswith('_') and f.endswith('.py')]
     26        return [f.rsplit('.', 1)[0] for f in os.listdir(command_dir)
     27                if not f.startswith('_')
     28                and (f.endswith('.py') or f.endswith('.pyc') or f.endswith('.pyo'))]
    2829    except OSError:
    2930        return []
    3031
Back to Top