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:
neiljp (Neil Pilgrim) 2018-01-07 09:21:27 -08:00 committed by showell
parent 9502e0eb9a
commit 2b172e08c7

View file

@ -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)