@@ -48,6 +48,7 @@ def numerical_risk_analysis(
4848 Returns:
4949 None; the response from the API is printed to the terminal.
5050 """
51+ import concurrent .futures
5152
5253 # Import the client library.
5354 import google .cloud .dlp
@@ -116,7 +117,7 @@ def callback(message):
116117
117118 try :
118119 subscription .result (timeout = timeout )
119- except TimeoutError :
120+ except concurrent . futures . TimeoutError :
120121 print (
121122 "No event received before the timeout. Please verify that the "
122123 "subscription provided is subscribed to the topic provided."
@@ -156,6 +157,7 @@ def categorical_risk_analysis(
156157 Returns:
157158 None; the response from the API is printed to the terminal.
158159 """
160+ import concurrent .futures
159161
160162 # Import the client library.
161163 import google .cloud .dlp
@@ -237,7 +239,7 @@ def callback(message):
237239
238240 try :
239241 subscription .result (timeout = timeout )
240- except TimeoutError :
242+ except concurrent . futures . TimeoutError :
241243 print (
242244 "No event received before the timeout. Please verify that the "
243245 "subscription provided is subscribed to the topic provided."
@@ -277,6 +279,7 @@ def k_anonymity_analysis(
277279 Returns:
278280 None; the response from the API is printed to the terminal.
279281 """
282+ import concurrent .futures
280283
281284 # Import the client library.
282285 import google .cloud .dlp
@@ -367,7 +370,7 @@ def callback(message):
367370
368371 try :
369372 subscription .result (timeout = timeout )
370- except TimeoutError :
373+ except concurrent . futures . TimeoutError :
371374 print (
372375 "No event received before the timeout. Please verify that the "
373376 "subscription provided is subscribed to the topic provided."
@@ -409,6 +412,7 @@ def l_diversity_analysis(
409412 Returns:
410413 None; the response from the API is printed to the terminal.
411414 """
415+ import concurrent .futures
412416
413417 # Import the client library.
414418 import google .cloud .dlp
@@ -509,7 +513,7 @@ def callback(message):
509513
510514 try :
511515 subscription .result (timeout = timeout )
512- except TimeoutError :
516+ except concurrent . futures . TimeoutError :
513517 print (
514518 "No event received before the timeout. Please verify that the "
515519 "subscription provided is subscribed to the topic provided."
@@ -558,6 +562,7 @@ def k_map_estimate_analysis(
558562 Returns:
559563 None; the response from the API is printed to the terminal.
560564 """
565+ import concurrent .futures
561566
562567 # Import the client library.
563568 import google .cloud .dlp
@@ -659,7 +664,7 @@ def callback(message):
659664
660665 try :
661666 subscription .result (timeout = timeout )
662- except TimeoutError :
667+ except concurrent . futures . TimeoutError :
663668 print (
664669 "No event received before the timeout. Please verify that the "
665670 "subscription provided is subscribed to the topic provided."
0 commit comments