IronPython with VS 2008

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

IronPython with VS 2008

This post has NOT been accepted by the mailing list yet.

I'm getting runtime / compile errors in Visual Studio 2008 in certain conditions - usually if an 'if' clause is being used within a try / except block:

            if filen != 'False':
                self._textBoxResults.AppendText('\r\nGot here')
                connection = testDbConnection()
                for host in filen:
                    self._textBoxResults.Text = 'Trying: ' + host
                    host, message1 = connection.TestHost(host)
                    self._textBoxResults.AppendText( host + ' ' + message1)
                self._textBoxResults.AppendText('\r\nUnable to open file')
VS won't allow the above code to be ran as it thinks the 'else:' keyword has an incorrect indent and that there is invalid sytax at the end of "connection = testDbConnection()".

If I comment out the whole 'for' block then it accepts the formatting / indents but when I put it back in it throws a paddy.

I've even tried putting it into notepad first to remove any hidden text formatters / EoF data but got the same results.

The excact errors are:

unexpected Token <else>
unexpected Token <:>
unexpected Token <indent>
unexpected Token <eof>
unexpected Token <else>
unexpected Token <:>

It's really driving me nuts as the code it correct and correctly indented, so there is nothing I can change - other than changing the whole execution flow to not have a for loop but I run into this problem all the time so idealy would like ot know the root cause of it.

Has anyone else encountered this at all?