Add Python 3.6 and 3.10 support, fixes #53

This commit is contained in:
Yohann D'ANELLO
2020-12-20 17:54:33 +01:00
parent 0b9606cbfe
commit 8afa082708
2 changed files with 44 additions and 10 deletions

View File

@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import curses
import sys
from typing import Any, Optional, Tuple, Union
from squirrelbattle.display.texturepack import TexturePack
@ -97,6 +98,8 @@ class Display:
attr |= curses.A_BOLD if bold else 0
attr |= curses.A_DIM if dim else 0
attr |= curses.A_INVIS if invis else 0
# Italic is supported since Python 3.7
italic &= sys.version_info >= (3, 7,)
attr |= curses.A_ITALIC if italic else 0
attr |= curses.A_NORMAL if normal else 0
attr |= curses.A_PROTECT if protect else 0