Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Commit 22db071

Browse files
committed
pushtotalk: relative import boilerplate
This is necesarry to make the script executable with python pushtotalk.py as well as python -m googlesamples.assistant.grpc.pushtotalk Change-Id: If66aafa29ad6a03fb0fbe6e66af5a663f108fe2c
1 parent a1e64af commit 22db071

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

google-assistant-sdk/googlesamples/assistant/grpc/pushtotalk.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@
2828
from google.rpc import code_pb2
2929
from tenacity import retry, stop_after_attempt, retry_if_exception
3030

31-
from . import (
32-
assistant_helpers,
33-
audio_helpers
34-
)
31+
try:
32+
from . import (
33+
assistant_helpers,
34+
audio_helpers
35+
)
36+
except SystemError:
37+
import assistant_helpers
38+
import audio_helpers
3539

3640

3741
ASSISTANT_API_ENDPOINT = 'embeddedassistant.googleapis.com'

0 commit comments

Comments
 (0)