rdbende/chlorophyll

None highlighted incorrectly after from keyword in Python code

rdbende opened this issue · 4 comments

@Moosems:

Paste the following:

from
None

None is highlighted as though it is an import

@rdbende:

When pasting this Pygments yields Token.Name.Builtin.Pseudo for None, even though it's Token.Keyword.Constant. Probably a bug there.

@Moosems:

Do you want to open an issue on pygments?

Pygments thinks it's part of a raise Exception from None statement. It doesn't do it with other constants, like True.

Bug to report to Pygments then?

Pygments thinks it's part of a raise Exception from None statement. It doesn't do it with other constants, like True.

And I was right. Pull request opened: pygments/pygments#2406

@rdbende Thanks! Now we just have to wait for a new release.