mypy: Turn on return value checks

Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
This commit is contained in:
Kovid Goyal
2021-10-26 22:39:14 +05:30
parent 5cb36a4632
commit 4494ddd8ff
52 changed files with 124 additions and 49 deletions
+4
View File
@@ -61,6 +61,7 @@ def platform_window_id(os_window_id: int) -> Optional[int]:
from .fast_data_types import x11_window_id
with suppress(Exception):
return x11_window_id(os_window_id)
return None
def load_shaders(name: str, vertex_name: str = '', fragment_name: str = '') -> Tuple[str, str]:
@@ -284,6 +285,7 @@ def init_startup_notification(window_handle: Optional[int], startup_id: Optional
except Exception:
import traceback
traceback.print_exc()
return None
def end_startup_notification(ctx: Optional['StartupCtx']) -> None:
@@ -500,6 +502,7 @@ def resolve_editor_cmd(editor: str, shell_env: Mapping[str, str]) -> Optional[st
q = shutil.which(editor_exe, path=shell_env['PATH'])
if q:
return patched(q)
return None
def get_editor_from_env(env: Mapping[str, str]) -> Optional[str]:
@@ -509,6 +512,7 @@ def get_editor_from_env(env: Mapping[str, str]) -> Optional[str]:
editor = resolve_editor_cmd(editor, env)
if editor:
return editor
return None
def get_editor_from_env_vars(opts: Optional[Options] = None) -> List[str]: