mypy: Correct SVN integration & satisfy strict-optional typing.
The commit_notice_destination return value was previously not checked against None, which indicates no message should be sent.
This commit is contained in:
parent
9502e0eb9a
commit
2b172e08c7
|
@ -66,10 +66,11 @@ message = "**{0}** committed revision r{1} to `{2}`.\n\n> {3}".format(
|
||||||
|
|
||||||
destination = config.commit_notice_destination(path, rev) # type: Optional[Dict[Text, Text]]
|
destination = config.commit_notice_destination(path, rev) # type: Optional[Dict[Text, Text]]
|
||||||
|
|
||||||
message_data = {
|
if destination is not None:
|
||||||
"type": "stream",
|
message_data = {
|
||||||
"to": destination["stream"],
|
"type": "stream",
|
||||||
"subject": destination["subject"],
|
"to": destination["stream"],
|
||||||
"content": message,
|
"subject": destination["subject"],
|
||||||
} # type: Dict[str, Any]
|
"content": message,
|
||||||
client.send_message(message_data)
|
} # type: Dict[str, Any]
|
||||||
|
client.send_message(message_data)
|
||||||
|
|
Loading…
Reference in a new issue