From d26e44ebb2638985701bd5c9929197706bd5d3c6 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sun, 7 Jan 2018 08:32:43 -0800 Subject: [PATCH] mypy: Add client_cert assertion & amend annotation in Zulip API. --- zulip/zulip/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 2f9c706..67faadb 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -397,7 +397,8 @@ class Client(object): # Build a client cert object for requests if self.client_cert_key is not None: - client_cert = (self.client_cert, self.client_cert_key) # type: Union[str, Tuple[str, str]] + assert(self.client_cert is not None) # Otherwise RuntimeError near end of __init__ + client_cert = (self.client_cert, self.client_cert_key) # type: Union[None, str, Tuple[str, str]] else: client_cert = self.client_cert