From bd890428a4c6e29376db398ebf076abb2258ae25 Mon Sep 17 00:00:00 2001 From: micbou Date: Wed, 7 Dec 2016 01:02:00 +0100 Subject: [PATCH] Fix exception when response future is not set --- python/ycm/client/completion_request.py | 3 ++- python/ycm/client/event_notification.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/ycm/client/completion_request.py b/python/ycm/client/completion_request.py index f4440b64..412e27c4 100644 --- a/python/ycm/client/completion_request.py +++ b/python/ycm/client/completion_request.py @@ -38,6 +38,7 @@ class CompletionRequest( BaseRequest ): def __init__( self, request_data ): super( CompletionRequest, self ).__init__() self.request_data = request_data + self._response_future = None def Start( self ): @@ -47,7 +48,7 @@ class CompletionRequest( BaseRequest ): def Done( self ): - return self._response_future.done() + return bool( self._response_future ) and self._response_future.done() def RawResponse( self ): diff --git a/python/ycm/client/event_notification.py b/python/ycm/client/event_notification.py index bd73f31f..cf87bf9f 100644 --- a/python/ycm/client/event_notification.py +++ b/python/ycm/client/event_notification.py @@ -37,6 +37,7 @@ class EventNotification( BaseRequest ): self._event_name = event_name self._filepath = filepath self._extra_data = extra_data + self._response_future = None self._cached_response = None @@ -51,7 +52,7 @@ class EventNotification( BaseRequest ): def Done( self ): - return self._response_future.done() + return bool( self._response_future ) and self._response_future.done() def Response( self ):