From 2b172e08c71b402216a4c0f855dd57caf1986ac3 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sun, 7 Jan 2018 09:21:27 -0800 Subject: [PATCH] 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. --- zulip/integrations/svn/post-commit | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zulip/integrations/svn/post-commit b/zulip/integrations/svn/post-commit index 9c44c5d..3d12979 100755 --- a/zulip/integrations/svn/post-commit +++ b/zulip/integrations/svn/post-commit @@ -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]] -message_data = { - "type": "stream", - "to": destination["stream"], - "subject": destination["subject"], - "content": message, -} # type: Dict[str, Any] -client.send_message(message_data) +if destination is not None: + message_data = { + "type": "stream", + "to": destination["stream"], + "subject": destination["subject"], + "content": message, + } # type: Dict[str, Any] + client.send_message(message_data)