Opened 13 years ago
Closed 13 years ago
#18387 closed New feature (fixed)
Provide a way to skip sys.exit() when using call_command()
Description ¶
When running a management command from Python code with call_command, any CommandError raised in the execute method will call sys.exit(1). This is not always desirable, so we should provide a way to call call_command without this flaw.
This should also allow us to fix issues like #10200 painlessly.
Change History (6)
by , 13 years ago
Attachment: | 18387-1.diff added |
---|
comment:1 by , 13 years ago
After discussion on #django-dev, added a new patch that does not add any new parameter to call_command, but move sys.exit(1) higher in the calling stack so that it is not used with call_command. Only commands run from command line will reach exit().
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Add raise_on_error option