4

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?

Roman
  • 64,384
  • 92
  • 238
  • 332

2 Answers2

5

Are you using Jython 2.4? try/except/finally was introduced in Python 2.5.

jd.
  • 10,678
  • 3
  • 46
  • 55
1

The Jython you have only supports Python 2.4; try ... except ... finally was added in 2.5.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358