From 010ad9dced46a04de127ba3a9e21063a44d2a166 Mon Sep 17 00:00:00 2001 From: L J Date: Wed, 17 Jan 2018 13:27:44 -0500 Subject: [PATCH] Fix subscription.open get called twice in the client libraries [(#1321)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1321) --- samples/snippets/subscriber.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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(