diff --git a/src/textual/widgets/_static.py b/src/textual/widgets/_static.py index 097d2cb165..b3e96f4688 100644 --- a/src/textual/widgets/_static.py +++ b/src/textual/widgets/_static.py @@ -2,32 +2,13 @@ from typing import TYPE_CHECKING -from rich.protocol import is_renderable - if TYPE_CHECKING: from textual.app import RenderResult -from textual.errors import RenderError from textual.visual import Visual, VisualType, visualize from textual.widget import Widget -def _check_renderable(renderable: object): - """Check if a renderable conforms to the Rich Console protocol - (https://rich.readthedocs.io/en/latest/protocol.html) - - Args: - renderable: A potentially renderable object. - - Raises: - RenderError: If the object can not be rendered. - """ - if not is_renderable(renderable) and not hasattr(renderable, "visualize"): - raise RenderError( - f"unable to render {renderable.__class__.__name__!r} type; must be a str, Text, Rich renderable oor Textual Visual instance" - ) - - class Static(Widget, inherit_bindings=False): """A widget to display simple static content, or use as a base class for more complex widgets.