docs: def get_seh():
      """
      Makes a function which can be used to set the ROOT error handler with a
      python function and returns the existing error handler.
      """
      if ON_RTD:
          return lambda x: x
  
      ErrorHandlerFunc_t = ctypes.CFUNCTYPE(
          None, ctypes.c_int, ctypes.c_bool,
          ctypes.c_char_p, ctypes.c_char_p)
  
      # Required to avoid strange dynamic linker problem on OSX.
      # See https://github.com/rootpy/rootpy/issues/256
      import ROOT
  
      dll = get_dll("libCore")
  
      SetErrorHandler = None
      try:
          if dll:
              SetErrorHandler = dll._Z15SetErrorHandlerPFvibPKcS0_E
      except AttributeError:
          pass
  
      if not SetErrorHandler:
          log.warning(
              "Couldn't find SetErrorHandler. "
              "Please submit a rootpy bug report.")
          return lambda x: None
  
      SetErrorHandler.restype = ErrorHandlerFunc_t
      SetErrorHandler.argtypes = ErrorHandlerFunc_t,
  
      def _SetErrorHandler(fn):
          """
          Set ROOT's warning/error handler. Returns the existing one.
          """
          log.debug("called SetErrorHandler()")
          eh = ErrorHandlerFunc_t(fn)
          # ``eh`` can get garbage collected unless kept alive, leading to a segfault.
          _keep_alive.append(eh)
          return SetErrorHandler(eh)
  
      return _SetErrorHandler