From a9e47d94254a8c4be6f4acca44c2ddbfa4ea87bf Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 17 Apr 2019 15:41:53 +0800 Subject: [PATCH] fix: regex match in Python 2.7/3.3/3.4/3.5 --- httprunner/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httprunner/parser.py b/httprunner/parser.py index 0162da30..924816a3 100644 --- a/httprunner/parser.py +++ b/httprunner/parser.py @@ -451,11 +451,11 @@ class LazyString(object): # search function like ${func($a, $b)} func_match = function_regex_compile.match(raw_string, match_start_position) if func_match: - function_meta = parse_function_params(func_match[1]) + function_meta = parse_function_params(func_match.group(1)) function_meta = { - "func_name": func_match[1] + "func_name": func_match.group(1) } - function_meta.update(parse_function_params(func_match[2])) + function_meta.update(parse_function_params(func_match.group(2))) lazy_func = LazyFunction( function_meta, self.functions_mapping,