#30305: Feature to set the returncode of a django custom command
-------------------------------+--------------------------------------
     Reporter:  stephanm       |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  closed
    Component:  Uncategorized  |                  Version:  master
     Severity:  Normal         |               Resolution:  invalid
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 `sys.exit()` works fine, e.g.

 {{{
 class Command(BaseCommand):
     def handle(self, *args, **options):
         sys.exit(43)
 }}}

 {{{
 > python manage.py test_command
 > echo $?
 43
 }}}

 All cleanup actions are honored (see
 [https://docs.python.org/3.6/library/sys.html#sys.exit sys.exit
 documentation]). Please use one of
 [https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
 support channels] if you have more questions.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30305#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.8b379591402630129c21385cbbe6cfaf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to