class_docstr_tok: []
code: def __exit__(
      self,
      type: type[BaseException] | None,
      value: BaseException | None,
      traceback: TracebackType | None,
  ) -> None:
      try:
          shutil.rmtree(path=self._dir)
      except Exception as e:
          # prefer original exception to rmtree exception
          if value is None:
              print(
                  f"Exception cleaning up TmpDir {self._dir}: {e}",
                  file=sys.stderr,
              )
              raise e
          else:
              print(
                  f"Failed to clean up TmpDir {self._dir}: {e}",
                  file=sys.stderr,
              )
              raise value
  
file_path: bokeh/tests/support/util/filesystem.py
imports: from __future__ import annotations
  import logging
  import os
  import shutil
  import sys
  import tempfile
  from contextlib import contextmanager
  from types import TracebackType
  from typing import IO, Awaitable, Callable, ContextManager, Iterator
  from bokeh.core.types import PathLike
label_desc: Use image node_id 2 for calling the TmpDir obj's underlying member method code with example usage: obj.__exit__(type, value, traceback) without return types