(b: BlockOrPrimitive)
| 109 | |
| 110 | |
| 111 | def wrap_block(b: BlockOrPrimitive) -> Block: |
| 112 | from .wrappers import convert_to_block |
| 113 | |
| 114 | # if isinstance(b, Page): |
| 115 | # raise DPClientError("Page objects can only be at the top-level") |
| 116 | if not isinstance(b, BaseBlock): |
| 117 | # import here as a very slow module due to nested imports |
| 118 | # from ..files import convert |
| 119 | |
| 120 | return convert_to_block(b) |
| 121 | return t.cast("Block", b) |
no test coverage detected