can only use parameter names (sep, maxsplit) in Python 3.x, not supported in Python2.x

This commit is contained in:
debugtalk
2017-06-28 21:47:10 +08:00
parent be60e8f0c0
commit 3d9777ba57

View File

@@ -69,7 +69,9 @@ def extract_response(resp_obj, context, delimiter='.'):
try:
if isinstance(value, str):
value += "."
top_query, sub_query = value.split(delimiter, maxsplit=1)
# string.split(sep=None, maxsplit=-1) -> list of strings
# e.g. "content.person.name" => ["content", "person.name"]
top_query, sub_query = value.split(delimiter, 1)
if top_query in ["body", "content", "text"]:
json_content = parse_response_body(resp_obj)