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:
|
||||||
|
message_data = {
|
||||||
"type": "stream",
|
"type": "stream",
|
||||||
"to": destination["stream"],
|
"to": destination["stream"],
|
||||||
"subject": destination["subject"],
|
"subject": destination["subject"],
|
||||||
"content": message,
|
"content": message,
|
||||||
} # type: Dict[str, Any]
|
} # type: Dict[str, Any]
|
||||||
client.send_message(message_data)
|
client.send_message(message_data)
|
||||||
|
|
Loading…
Reference in a new issue