Upgrade mypy to version 0.931 (#12030)

Upgrade mypy to 0.931, mypy-zope to 0.3.5 and fix new complaints.
This commit is contained in:
Sean Quah 2022-02-18 15:57:26 +00:00 committed by GitHub
parent eb609c65d0
commit e6acd3cf4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 19 deletions

View file

@ -14,7 +14,7 @@
import functools
import sys
from typing import Any, Callable, Generator, List, TypeVar
from typing import Any, Callable, Generator, List, TypeVar, cast
from twisted.internet import defer
from twisted.internet.defer import Deferred
@ -174,7 +174,9 @@ def _check_yield_points(
)
)
changes.append(err)
return getattr(e, "value", None)
# The `StopIteration` or `_DefGen_Return` contains the return value from the
# generator.
return cast(T, e.value)
frame = gen.gi_frame