File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import requests
22import time
3+ import sys
34from pagination import Pagination
45from safe_logger import SafeLogger
56from loop_detector import LoopDetector
@@ -16,7 +17,7 @@ def template_dict(dictionnary, **kwargs):
1617 for key in ret :
1718 if isinstance (ret [key ], dict ):
1819 ret [key ] = template_dict (ret [key ], ** kwargs )
19- if isinstance (ret [key ], str ):
20+ if is_string (ret [key ]):
2021 ret [key ] = format_template (ret [key ], ** kwargs )
2122 return ret
2223 return ret
@@ -33,6 +34,14 @@ def format_template(template, **kwargs):
3334 return formated
3435
3536
37+ def is_string (item ):
38+ python_version = sys .version_info
39+ if python_version >= (3 , 0 , 0 ):
40+ return isinstance (item , str )
41+ else :
42+ return isinstance (item , str ) or isinstance (item , unicode )
43+
44+
3645class RestAPIClientError (ValueError ):
3746 pass
3847
You can’t perform that action at this time.
0 commit comments