Opened 13 years ago

Closed 13 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

Description

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

             app_name = get_commands()[subcommand]

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


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


Change History (1)

comment:1 by Julien Phalip, 13 years ago

Resolution: invalid
Status: newclosed

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/__init__.py?rev=16222#L70

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