Skip to content

Commit 3fb2527

Browse files
committed
Make use of isintance for better performance
1 parent e28d1d5 commit 3fb2527

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tb_rest_client/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ def request(self, method, url, query_params=None, headers=None,
161161
if re.search('json', headers['Content-Type'], re.IGNORECASE):
162162
request_body = '{}'
163163
if body is not None:
164-
if type(body) is not str:
165-
request_body = json.dumps(body)
166-
else:
164+
if isinstance(body, str):
167165
request_body = body
166+
else:
167+
request_body = json.dumps(body)
168168
r = self.pool_manager.request(
169169
method, url,
170170
body=request_body,

0 commit comments

Comments
 (0)