We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d77d1f commit 5fb10cfCopy full SHA for 5fb10cf
language/snippets/cloud-client/v1/snippets.py
@@ -27,7 +27,6 @@
27
28
def sentiment_text():
29
# [START language_sentiment_text]
30
- import six
31
from google.cloud import language
32
from google.cloud.language import enums
33
from google.cloud.language import types
@@ -36,8 +35,10 @@ def sentiment_text():
36
35
37
client = language.LanguageServiceClient()
38
39
- if isinstance(text, six.binary_type):
+ try:
40
text = text.decode('utf-8')
+ except AttributeError:
41
+ pass
42
43
# Instantiates a plain text document.
44
# [START language_python_migration_sentiment_text]
0 commit comments