Skip to content

Commit a0c3159

Browse files
committed
refactor(static): remove unused _check_renderable function
Remove the `_check_renderable` function, which has been unused since the new render protocol was introduced in Textual v0.86.0.
1 parent a3f7b98 commit a0c3159

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/textual/widgets/_static.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,13 @@
22

33
from typing import TYPE_CHECKING
44

5-
from rich.protocol import is_renderable
6-
75
if TYPE_CHECKING:
86
from textual.app import RenderResult
97

10-
from textual.errors import RenderError
118
from textual.visual import Visual, VisualType, visualize
129
from textual.widget import Widget
1310

1411

15-
def _check_renderable(renderable: object):
16-
"""Check if a renderable conforms to the Rich Console protocol
17-
(https://rich.readthedocs.io/en/latest/protocol.html)
18-
19-
Args:
20-
renderable: A potentially renderable object.
21-
22-
Raises:
23-
RenderError: If the object can not be rendered.
24-
"""
25-
if not is_renderable(renderable) and not hasattr(renderable, "visualize"):
26-
raise RenderError(
27-
f"unable to render {renderable.__class__.__name__!r} type; must be a str, Text, Rich renderable oor Textual Visual instance"
28-
)
29-
30-
3112
class Static(Widget, inherit_bindings=False):
3213
"""A widget to display simple static content, or use as a base class for more complex widgets.
3314

0 commit comments

Comments
 (0)