              self.assertNotIn("Traceback", err_message)
              self.assertIn("CommandError", err_message)
  
              err.truncate(0)
              with self.assertRaises(CommandError):
                  command.run_from_argv(['', '', '--traceback'])
          finally:
              sys.stderr = old_stderr
  
 
</s> remove             with self.assertRaises(SystemExit):
 </s> add             with self.assertRaises(CommandError): </s> remove             err_message = err.getvalue()
            self.assertIn("Traceback (most recent call last)", err_message)
            self.assertIn("CommandError", err_message)
 </s> add  </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()
            # Exceptions other than CommandError automatically output the traceback
            self.assertIn("Traceback", err_message)
            self.assertIn("TypeError", err_message)
 </s> add 
            # If the Exception is CommandError and --traceback is present
            # this command should raise the original CommandError as if it
            # were not a CommandError.
              self.assertNotIn("Traceback", err_message)
              self.assertIn("CommandError", err_message)
  
            # If the Exception is CommandError and --traceback is present
            # this command should raise the original CommandError as if it
            # were not a CommandError.
              err.truncate(0)
              with self.assertRaises(CommandError):
                  command.run_from_argv(['', '', '--traceback'])
          finally:
              sys.stderr = old_stderr
  
keep keep add keep keep keep keep keep keep
 Fixed #20445 -- Raised original exception after command error 
tests/admin_scripts/tests.py