Changes to make updated mypy happy

This commit is contained in:
Kovid Goyal 2023-02-07 18:10:43 +05:30
parent 9e35d26188
commit dd07a8c4a4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -136,8 +136,8 @@ class Clipboard:
def __call__(self, mime: str) -> Callable[[], bytes]:
data = self.data.get(mime, b'')
if isinstance(data, str): # type: ignore
data = data.encode('utf-8') # type: ignore
if isinstance(data, str):
data = data.encode('utf-8')
if isinstance(data, bytes):
def chunker() -> bytes:
nonlocal data

View File

@ -36,7 +36,7 @@ FontMap = Dict[str, Dict[str, List[FontConfigPattern]]]
def create_font_map(all_fonts: Tuple[FontConfigPattern, ...]) -> FontMap:
ans: FontMap = {'family_map': {}, 'ps_map': {}, 'full_map': {}}
for x in all_fonts:
if 'path' not in x:
if not x.get('path'):
continue
f = (x.get('family') or '').lower()
full = (x.get('full_name') or '').lower()