mirror of https://github.com/zulip/zulip.git
mypy: Refactor extract_recipients in actions.py to remove type ignore.
This commit is contained in:
parent
5ab64daecc
commit
12f3ed12c4
|
@ -1945,9 +1945,13 @@ def extract_recipients(
|
||||||
) -> Union[List[str], List[int]]:
|
) -> Union[List[str], List[int]]:
|
||||||
# We try to accept multiple incoming formats for recipients.
|
# We try to accept multiple incoming formats for recipients.
|
||||||
# See test_extract_recipients() for examples of what we allow.
|
# See test_extract_recipients() for examples of what we allow.
|
||||||
try:
|
|
||||||
data = ujson.loads(s) # type: ignore # This function has a super weird union argument.
|
if isinstance(s, str):
|
||||||
except (ValueError, TypeError):
|
try:
|
||||||
|
data = ujson.loads(s)
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
data = s
|
||||||
|
else:
|
||||||
data = s
|
data = s
|
||||||
|
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
|
|
Loading…
Reference in New Issue