code: def safe_reload(modname: types.ModuleType) -> Union[None, str]:
      
      try:
          importlib.reload(modname)
          return None
      except Exception as e:
          logging.error("Failed to reimport module: %s", modname)
          msg, _ = backtrace.output_traceback(e)
          return msg
docs: Catch and log any errors that arise from reimporting a module, but do not die.
  
      :return: None when import was successful. String is the first line of the error message