Skip to content

Commit 506afe6

Browse files
committed
Cleaner approach
1 parent b17b65d commit 506afe6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

python-lib/rest_api_client.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import requests
22
import time
3-
import sys
43
from pagination import Pagination
54
from safe_logger import SafeLogger
65
from loop_detector import LoopDetector
@@ -33,12 +32,9 @@ def format_template(template, **kwargs):
3332
return formated
3433

3534

36-
def is_string(item):
37-
python_version = sys.version_info
38-
if python_version >= (3, 0, 0):
39-
return isinstance(item, str)
40-
else:
41-
return isinstance(item, str) or isinstance(item, unicode)
35+
def is_string(data):
36+
data_type = type(data).__name__
37+
return data_type in ["str", "unicode"]
4238

4339

4440
class RestAPIClientError(ValueError):

0 commit comments

Comments
 (0)