Skip to content

Commit 84b052d

Browse files
committed
Tone: Attempt to address lint error
1 parent 02d954c commit 84b052d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

watson_developer_cloud/tone_analyzer_v3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def tone(self, text, tones=None, sentences=None, content_type='text/plain'):
5757
:param content_type: The type of the input content: "text/plain"
5858
(the default), "text/html", or "application/json".
5959
"""
60+
6061
params = {'version': self.version}
6162
if tones is not None:
6263
params['tones'] = tones
@@ -72,7 +73,8 @@ def tone(self, text, tones=None, sentences=None, content_type='text/plain'):
7273
return self.request(
7374
method='POST', headers=headers, url='/v3/tone', params=params,
7475
json=text, accept_json=True)
75-
else:
76+
77+
if content_type == 'text/html':
7678
return self.request(
7779
method='POST', headers=headers, url='/v3/tone', params=params,
7880
data=text, accept_json=True)

0 commit comments

Comments
 (0)