Merge pull request #7442 from gnikonorov/issue_7439

fix mypy issue by using typing Match instead of re.Match
This commit is contained in:
Ran Benita 2020-07-03 10:23:52 +03:00 committed by GitHub
commit bd4977eba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import sys
from datetime import datetime from datetime import datetime
from typing import Dict from typing import Dict
from typing import List from typing import List
from typing import Match
from typing import Optional from typing import Optional
from typing import Tuple from typing import Tuple
from typing import Union from typing import Union
@ -70,7 +71,7 @@ _py_ext_re = re.compile(r"\.py$")
def bin_xml_escape(arg: str) -> py.xml.raw: def bin_xml_escape(arg: str) -> py.xml.raw:
def repl(matchobj: "re.Match[str]") -> str: def repl(matchobj: Match[str]) -> str:
i = ord(matchobj.group()) i = ord(matchobj.group())
if i <= 0xFF: if i <= 0xFF:
return "#x%02X" % i return "#x%02X" % i