Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix decode problem

* fix decode

* fix decode
  • Loading branch information
andrewferlitsch authored and Alex Hong committed Dec 6, 2018
1 parent 9aa23e6 commit 38ba307
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samples/snippets/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

def sentiment_text():
# [START language_sentiment_text]
import six
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
Expand All @@ -36,8 +35,10 @@ def sentiment_text():

client = language.LanguageServiceClient()

if isinstance(text, six.binary_type):
try:
text = text.decode('utf-8')
except AttributeError:
pass

# Instantiates a plain text document.
# [START language_python_migration_sentiment_text]
Expand Down

0 comments on commit 38ba307

Please sign in to comment.