Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 56e1b34

Browse filesBrowse files
andrewferlitschAlex Hong
authored andcommitted
* fix decode problem * fix decode * fix decode
1 parent 93c3656 commit 56e1b34
Copy full SHA for 56e1b34

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎language/cloud-client/v1/snippets.py

Copy file name to clipboardExpand all lines: language/cloud-client/v1/snippets.py
+3-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.