编程语言
首页 > 编程语言> > python – ‘finally’单词上的Jython语法错误

python – ‘finally’单词上的Jython语法错误

作者:互联网

这是一个导致错误的片段:

net.grinder.scriptengine.jython.JythonScriptExecutionException: SyntaxError: ('invalid syntax', ('C:\\grinder-3.7.1\\lib
\\.\\nb-romg-file-store\\current\\grinder_test.py', 131, 9, '        finally:'))
    ss = ''
    self._suggestionLock.acquire()
    try:
        ss = suggestion_strings.next()
    except StopIteration:
        suggestion_strings = suggestions_generator()
        ss = suggestion_strings.next()
    finally:
        self._suggestionLock.release()

这可能有什么问题?

解决方法:

你在使用Jython 2.4吗? try / except / finally在Python 2.5中引入.

标签:python,exception-handling,jython,grinder
来源: https://codeday.me/bug/20190530/1184106.html