Skip to content

Commit 721abf6

Browse files
committed
compatibility
1 parent 5a41900 commit 721abf6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/textual/canvas.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from __future__ import annotations
1010

11+
import sys
1112
from array import array
1213
from collections import defaultdict
1314
from dataclasses import dataclass
@@ -157,7 +158,10 @@ def __init__(self, width: int, height: int) -> None:
157158
self._width = width
158159
self._height = height
159160
blank_line = " " * width
160-
self.lines: list[array[str]] = [array("w", blank_line) for _ in range(height)]
161+
self.lines: list[array[str]] = [
162+
array("w" if sys.version_info >= (3, 13) else "u", blank_line)
163+
for _ in range(height)
164+
]
161165
self.box: list[defaultdict[int, Quad]] = [
162166
defaultdict(lambda: (0, 0, 0, 0)) for _ in range(height)
163167
]

0 commit comments

Comments
 (0)