Jython syntax error on 'finally' word
-
13-12-2019 - |
Question
Here's a snippet which causes an error:
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()
What may be wrong here?
Solution
Are you using Jython 2.4? try/except/finally was introduced in Python 2.5.
OTHER TIPS
The Jython you have only supports Python 2.4; try ... except ... finally
was added in 2.5.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow