Ticket #16167: 16167.package_commands.diff

File 16167.package_commands.diff, 785 bytes (added by Marwan Alsabbagh <marwan.alsabbagh@…>, 4 years ago)
  • 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[:-3] for f in os.listdir(command_dir)
     27                if not f.startswith('_') and f.endswith('.py')] +
     28               [f for f in os.listdir(command_dir)
     29                if not f.startswith('_')
     30                and os.path.exists(os.path.join(command_dir, f, '__init__.py'))])
    2831    except OSError:
    2932        return []
    3033
Back to Top