pygments not working with Python3

Issue #922 invalid
created an issue

I am attempting to port a plugin that uses pygments from Python2 to Python3 and I am running into several issues in the pygments source. There are several syntax errors that appear to be related to Python 3 changes that have not been updated in pygments.

Does Python3 support require something like 2to3?

A couple of examples:

File "/home/user/src/pygments/", line 46
    except TypeError, err:

From what I can tell, this should be:

    except TypeError as err:

in pygments/lexers/ The print statement is missing parens.

These issues occur in multiple places and are easy enough to fix. However, now I'm getting a syntax error in that I assume has something to do with changes to the behavior of backslashes in literal strings.

I am sure others are using Python 3. Is there something special I need to do before importing pygments?

Comments (3)

  1. Log in to comment