Closed
Description
from typing import Union
def post(path: str) -> Union[requests.models.Response, ManualException]
try:
return requests.post(path)
except:
raise ManualException
def call() -> List:
try:
resp = post('path')
except ManualException:
return []
return resp.content
On running mypy
Item "ManualException" of "Union[Response, ManualException]" has no attribute "content"
Ideally mypy should not raise any error, because I am handling the case when exception is raised.
Metadata
Metadata
Assignees
Labels
No labels