  import os
  import sys
  
  from optparse import make_option, OptionParser
  import traceback
  
  import django
  from django.core.exceptions import ImproperlyConfigured
  from django.core.management.color import color_style
  from django.utils.encoding import force_str
 
</s> remove             err_message = err.getvalue()
            # Exceptions other than CommandError automatically output the traceback
            self.assertIn("Traceback", err_message)
            self.assertIn("TypeError", err_message)
 </s> add  </s> remove             help='Print traceback on exception'),
 </s> add             help='Raise on exception'), </s> remove             with self.assertRaises(SystemExit):
 </s> add             # If the Exception is not CommandError it should always
            # raise the original exception.
            with self.assertRaises(TypeError): </s> remove             err_message = err.getvalue()
            self.assertIn("Traceback (most recent call last)", err_message)
            self.assertIn("CommandError", err_message)
 </s> add 
  import os
  import sys
  
  from optparse import make_option, OptionParser

  
  import django
  from django.core.exceptions import ImproperlyConfigured
  from django.core.management.color import color_style
  from django.utils.encoding import force_str
keep keep keep keep replace keep keep keep keep keep
 Fixed #20445 -- Raised original exception after command error 
django/core/management/base.py