diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index 577e77cb9..1fd480e59 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -124,9 +124,8 @@ def callback(message): # Blocks the thread while messages are coming in through the stream. Any # exceptions that crop up on the thread will be set on the future. - future = subscription.open(callback) try: - future.result() + subscription.future.result() except Exception as e: print( 'Listening for messages on {} threw an Exception: {}.'.format(