lint: Migrate typing.Text check to semgrep.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-11-16 17:39:23 -08:00
committed by Anders Kaseorg
parent e5779c1ca0
commit d0d8c358b3
5 changed files with 13 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
from typing import Callable, List, Optional, Text
from typing import Callable, List, Optional
class FormattedException(Exception):
@@ -306,7 +306,7 @@ OPTIONAL_CLOSING_TAGS = [
'stop',
]
def is_self_closing_html_tag(s: Text, tag: Text) -> bool:
def is_self_closing_html_tag(s: str, tag: str) -> bool:
if s.endswith('/>'):
if tag in OPTIONAL_CLOSING_TAGS:
return True