Issue #105 invalid

try / except / finally causes parser to fail

ebmeierj
created an issue

It appears that there is a problem with the new try / except / finally statement which is supported by python as of version 2.5.

Example: {{{

!python

import sys from coverage import coverage coverage(data_file='coverage.dat', auto_data=True).start()

def main(): try: print "hello world"

except:
    print "exception"

finally:
    print "world contacted"

if name == "main": main() }}}

Then if you run {{{

!python

import sys from coverage import *

cov = coverage(data_file='coverage.dat') cov.load() cov.report() }}}

You will see the following exception: CoverageException: Couldn't parse '/interact/test/test.py' as Python source: 'invalid syntax' at line 14

(The line that the error happens on is the finally following the except.)

Comments (2)

  1. Log in to comment