简体   繁体   中英

getting syntax error from nifi ExecuteScript processor inspite of correct python code

I am getting below error inspite of correct python code don't know how to resolve this error. Any help is much appreciated

org.apache.nifi.processor.exception.ProcessException: javax.script.ScriptException: SyntaxError: no viable alternative at input '*' in <script> at line number 35 at column number 26

python code

def get_match_list(regEx, line):
    match = re.search(regEx, line)
    print(match)
    if match:
        match_list = [*match.groups()] # this is the line exception is pointed
        return match_list
    else:
        return []

看起来 jython使用python 2.7 并且因为Unpacking Generalizations是 python 3.5 中引入的一个特性,你不能在 jython 中使用这个语法,所以将元组转换为列表的另一种方法是使用list ( match.groups)它可以工作在旧版本的 python 和当前版本的 jython (2.7.2) 中很好

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM