Skip to content

Instantly share code, notes, and snippets.

@loic
Created October 19, 2014 11:47
Show Gist options
  • Select an option

  • Save loic/f9fb0de82eebeeefd62f to your computer and use it in GitHub Desktop.

Select an option

Save loic/f9fb0de82eebeeefd62f to your computer and use it in GitHub Desktop.
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 910b43e..6ee80a3 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -93,8 +93,7 @@ class OutputWrapper(object):
ending = self.ending if ending is None else ending
if ending and not msg.endswith(ending):
msg += ending
- style_func = [f for f in (style_func, self.style_func, lambda x:x)
- if f is not None][0]
+ style_func = style_func or self.style_func or (lambda x:x)
self._out.write(force_str(style_func(msg)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment