Python 2 does not support this syntax?

Hi,

I've configured my project's interpreter to point at a python2.6 executable, but when I use code like this:

except Exception as out:

    print out

It gets highlighted by PyCharm, and it tells me 'python 2 does not support this syntax'. Well, Python 2.6 *does* support that syntax. I've tried everything I can think of to get rid of the highlighting of this code. I ran the inspector and then disabled the "Annotator" bit where those errors showed up, but they don't change the highlighting. I tried checking the option to highlight unsupported syntax in python *3*, and that seemed to be a no-op (my print statements were not highlighted, for example), I tried reloading my interpreter, restarting the IDE, and probably a few things I've forgotten now.

The documentation on 'Inspecting Source Code' says to use File->Settings->Inspections to alter things, but I tried that, and it didn't affect any change in the highlighting. Using 'Hector' in the status bar basically gives me the option of turning off inspection altogether, getting rid of any highlighting at all. Running an inspection and disabling things in the output window works until I reopen the file, and of course has no affect on the rest of the project's files anyway.

What I want is to have highlighting like this that is specific to the version of Python I'm using. Please let me know if that's supported, and what I'm doing wrong/missing, if anything.

thanks.

0
1 comment

Hello Brian,

This highlighting is, of course, a bug and is going to be fixed in the next

PyCharm update. Unfortunately it's not configurable.

I've configured my project's interpreter to point at a python2.6

executable, but when I use code like this:

except Exception as out:

print out

It gets highlighted by PyCharm, and it tells me 'python 2 does not

support this syntax'. Well, Python 2.6 does support that syntax.

I've tried everything I can think of to get rid of the highlighting of

this code. I ran the inspector and then disabled the "Annotator" bit

where those errors showed up, but they don't change the highlighting.

I tried checking the option to highlight unsupported syntax in python

3, and that seemed to be a no-op (my print statements were not

highlighted, for example), I tried reloading my interpreter,

restarting the IDE, and probably a few things I've forgotten now.

The documentation on 'Inspecting Source Code' says to use

File->Settings->Inspections to alter things, but I tried that, and it

didn't affect any change in the highlighting. Using 'Hector' in the

status bar basically gives me the option of turning off inspection

altogether, getting rid of any highlighting at all. Running an

inspection and disabling things in the output window works until I

reopen the file, and of course has no affect on the rest of the

project's files anyway.

What I want is to have highlighting like this that is specific to the

version of Python I'm using. Please let me know if that's supported,

and what I'm doing wrong/missing, if anything.

thanks.

---

Original message URL:

http://www.jetbrains.net/devnet/message/5257766#5257766

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.