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]]:
|
||||
# We try to accept multiple incoming formats for recipients.
|
||||
# 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.
|
||||
except (ValueError, TypeError):
|
||||
|
||||
if isinstance(s, str):
|
||||
try:
|
||||
data = ujson.loads(s)
|
||||
except (ValueError, TypeError):
|
||||
data = s
|
||||
else:
|
||||
data = s
|
||||
|
||||
if isinstance(data, str):
|
||||
|
|
Loading…
Reference in New Issue