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?

Was it helpful?

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
scroll top