do not fail if default formatter is unloadable
This commit is contained in:
parent
a854d72209
commit
c7d9ef413f
1 changed files with 7 additions and 1 deletions
|
|
@ -212,7 +212,13 @@ class ConsoleApplication(BaseApplication):
|
|||
|
||||
def set_default_formatter(self, name):
|
||||
if not self.options.formatter:
|
||||
self.formatter = load_formatter(name)
|
||||
try:
|
||||
self.formatter = load_formatter(name)
|
||||
except ImportError:
|
||||
default_name = 'multiline'
|
||||
logging.error('Could not load default formatter "%s" for this command. Falling back to "%s".' % (
|
||||
name, default_name))
|
||||
self.formatter = load_formatter(default_name)
|
||||
|
||||
def set_formatter_header(self, string):
|
||||
self.formatter.set_header(string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue