Ticket #9158: django-admin-stdout.diff

File django-admin-stdout.diff, 1.6 KB (added by Petr Marhoun <petr.marhoun@…>, 16 years ago)
  • django/core/management/__init__.py

    === modified file 'django/core/management/__init__.py'
     
    248248            else:
    249249                klass = load_command_class(app_name, subcommand)
    250250        except KeyError:
    251             sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
     251            sys.stdout.write("Unknown command: %r\nType '%s help' for usage.\n" % \
    252252                (subcommand, self.prog_name))
    253253            sys.exit(1)
    254254        return klass
     
    273273        try:
    274274            subcommand = self.argv[1]
    275275        except IndexError:
    276             sys.stderr.write("Type '%s help' for usage.\n" % self.prog_name)
     276            sys.stdout.write("Type '%s help' for usage.\n" % self.prog_name)
    277277            sys.exit(1)
    278278
    279279        if subcommand == 'help':
     
    281281                self.fetch_command(args[2]).print_help(self.prog_name, args[2])
    282282            else:
    283283                parser.print_lax_help()
    284                 sys.stderr.write(self.main_help_text() + '\n')
     284                sys.stdout.write(self.main_help_text() + '\n')
    285285                sys.exit(1)
    286286        # Special-cases: We want 'django-admin.py --version' and
    287287        # 'django-admin.py --help' to work, for backwards compatibility.
     
    290290            pass
    291291        elif self.argv[1:] == ['--help']:
    292292            parser.print_lax_help()
    293             sys.stderr.write(self.main_help_text() + '\n')
     293            sys.stdout.write(self.main_help_text() + '\n')
    294294        else:
    295295            self.fetch_command(subcommand).run_from_argv(self.argv)
    296296
Back to Top