Fix exception when response future is not set

This commit is contained in:
micbou 2016-12-07 01:02:00 +01:00
parent 48b7ccef76
commit bd890428a4
No known key found for this signature in database
GPG Key ID: C7E8FD1F3BDA1E05
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,7 @@ class CompletionRequest( BaseRequest ):
def __init__( self, request_data ): def __init__( self, request_data ):
super( CompletionRequest, self ).__init__() super( CompletionRequest, self ).__init__()
self.request_data = request_data self.request_data = request_data
self._response_future = None
def Start( self ): def Start( self ):
@ -47,7 +48,7 @@ class CompletionRequest( BaseRequest ):
def Done( self ): def Done( self ):
return self._response_future.done() return bool( self._response_future ) and self._response_future.done()
def RawResponse( self ): def RawResponse( self ):

View File

@ -37,6 +37,7 @@ class EventNotification( BaseRequest ):
self._event_name = event_name self._event_name = event_name
self._filepath = filepath self._filepath = filepath
self._extra_data = extra_data self._extra_data = extra_data
self._response_future = None
self._cached_response = None self._cached_response = None
@ -51,7 +52,7 @@ class EventNotification( BaseRequest ):
def Done( self ): def Done( self ):
return self._response_future.done() return bool( self._response_future ) and self._response_future.done()
def Response( self ): def Response( self ):