Skip to content

Commit 6b4d884

Browse files
committed
Prevent older versions of tcod from running TTF example.
Older versions will crash the script.
1 parent 023cd70 commit 6b4d884

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/ttf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@ def main() -> None:
9696

9797

9898
if __name__ == "__main__":
99+
tcod_version = tuple(
100+
int(n) for n in tcod.__version__.split(".") if n.isdigit()
101+
)
102+
assert tcod_version[:2] >= (12, 1), "Must be using tcod 12.1 or later."
99103
main()

0 commit comments

Comments
 (0)