gpt4 book ai didi

python - 'finally' 字的 Jython 语法错误

转载 作者:太空狗 更新时间:2023-10-30 02:34:11 26 4
gpt4 key购买 nike

这是导致错误的片段:

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 - 'finally' 字的 Jython 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9685861/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com