From 731c802fcdb396c197e79824b1ef2e1cd1773e01 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 30 Aug 2018 19:03:14 +0300 Subject: [PATCH] Only import deque in type checking mode to fix 3.5 runtime support --- mautrix_telegram/formatter/from_matrix/parser_htmlparser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py b/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py index ad085fe9..464c3fae 100644 --- a/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py +++ b/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from typing import (Optional, List, Tuple, Type, Dict, Any, Deque, Match) +from typing import (Optional, List, Tuple, Type, Dict, Any, TYPE_CHECKING, Match) from html import unescape from html.parser import HTMLParser from collections import deque @@ -29,6 +29,9 @@ from ... import user as u, puppet as pu, portal as po from ..util import html_to_unicode from .parser_common import MatrixParserCommon, ParsedMessage +if TYPE_CHECKING: + from typing import Deque + def parse_html(html: str) -> ParsedMessage: parser = MatrixParser()