code: def excepthook(type, value, traceback):  # pylint: disable=unused-argument
      
      try:
          six.reraise(type, value, traceback)
      except type:
          _LOGGER.exception(str(value))
      if isinstance(value, KeyboardInterrupt):
          message = "Cancelling at the user's request."
      else:
          message = handle_unexpected_exception(value)
      print(message, file=sys.stderr)
docs: Log exceptions instead of printing a traceback to stderr.