From 2d3b95a0881d65a39f59ed7d927cefc798daab41 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Tue, 8 Aug 2017 16:48:33 -0700 Subject: [PATCH] mypy: Annotate sent_time_in_epoch_seconds taking Optional[UserMessage]. --- zerver/views/home.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zerver/views/home.py b/zerver/views/home.py index e12d8609f4..ad4dd1c75c 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -59,9 +59,8 @@ def accounts_accept_terms(request): ) def sent_time_in_epoch_seconds(user_message): - # type: (UserMessage) -> Optional[float] - # user_message is a UserMessage object. - if not user_message: + # type: (Optional[UserMessage]) -> Optional[float] + if user_message is None: return None # We have USE_TZ = True, so our datetime objects are timezone-aware. # Return the epoch seconds in UTC.