From e1e090a289aa8632a737c8e2757239c86a823e83 Mon Sep 17 00:00:00 2001 From: Tianzi Cai Date: Thu, 6 Sep 2018 17:28:27 -0700 Subject: [PATCH] Fixed return object from `subscriber.subscribe()` [(#1685)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1685) --- samples/snippets/subscriber.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index 38f1e527f..e31560722 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -255,13 +255,13 @@ def callback(message): print('Received message: {}'.format(message)) message.ack() - subscription = subscriber.subscribe(subscription_path, callback=callback) + future = subscriber.subscribe(subscription_path, callback=callback) # 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. try: # When timeout is unspecified, the result method waits indefinitely. - subscription.future.result(timeout=30) + future.result(timeout=30) except Exception as e: print( 'Listening for messages on {} threw an Exception: {}.'.format(