Opened 4 years ago

Closed 4 years ago

#16695 closed Uncategorized (invalid)

a line which is never executed

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.3
Severity: Normal Keywords: management
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


    def fetch_command(self, subcommand):
        Tries to fetch the given subcommand, printing a message with the
        appropriate command called from the command line (usually
        "" or "") if it can't be found.

             app_name = get_commands()[subcommand]

        except KeyError:
            sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
                (subcommand, self.prog_name))
        if isinstance(app_name, BaseCommand):
            # If the command is already loaded, use it directly.
            klass = app_name
            klass = load_command_class(app_name, subcommand)
        return klass

isinstance(app_name, BaseCommand) this line will always be false

Change History (1)

comment:1 Changed 4 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

This condition will be true for the startapp command. Please refer to get_commands()'s docstring for more info: source:django/trunk/django/core/management/

Note: See TracTickets for help on using tickets.
Back to Top