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

Commit 02eaf3b

Browse files
andrewferlitschbusunkim96
authored andcommitted
* fix decode problem * fix decode * fix decode
1 parent f4582b1 commit 02eaf3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

samples/snippets/cloud-client/v1/snippets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
def sentiment_text():
2929
# [START language_sentiment_text]
30-
import six
3130
from google.cloud import language
3231
from google.cloud.language import enums
3332
from google.cloud.language import types
@@ -36,8 +35,10 @@ def sentiment_text():
3635

3736
client = language.LanguageServiceClient()
3837

39-
if isinstance(text, six.binary_type):
38+
try:
4039
text = text.decode('utf-8')
40+
except AttributeError:
41+
pass
4142

4243
# Instantiates a plain text document.
4344
# [START language_python_migration_sentiment_text]

0 commit comments

Comments
 (0)