Skip to content

Commit 5f5b590

Browse files
authored
Merge pull request #2665 from dhermes/speech-no-more-condl-import
Removing ImportError check in Speech client.
2 parents a776e50 + 5a3cc5e commit 5f5b590

File tree

1 file changed

+2
-10
lines changed
  • packages/google-cloud-speech/google/cloud/speech

1 file changed

+2
-10
lines changed

packages/google-cloud-speech/google/cloud/speech/client.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,15 @@
2222
from google.cloud.client import Client as BaseClient
2323
from google.cloud.environment_vars import DISABLE_GRPC
2424

25+
from google.cloud.speech._gax import GAPICSpeechAPI
2526
from google.cloud.speech.connection import Connection
2627
from google.cloud.speech.encoding import Encoding
2728
from google.cloud.speech.operation import Operation
2829
from google.cloud.speech.sample import Sample
2930
from google.cloud.speech.alternative import Alternative
3031

31-
try:
32-
from google.cloud.speech._gax import GAPICSpeechAPI
33-
except ImportError: # pragma: NO COVER
34-
_HAVE_GAX = False
35-
GAPICSpeechAPI = None
36-
else:
37-
_HAVE_GAX = True
3832

39-
40-
_DISABLE_GAX = os.getenv(DISABLE_GRPC, False)
41-
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX
33+
_USE_GAX = not os.getenv(DISABLE_GRPC, False)
4234

4335

4436
class Client(BaseClient):

0 commit comments

Comments
 (0)