1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #739 resolved

python 2.4: invalid syntax in sql.py

Christian Ebert
created an issue

{{{ $ python setup.py install --home=~ [...] byte-compiling /home/username/lib/python/pygments/lexers/sql.py to sql.pyc File "/home/username/lib/python/pygments/lexers/sql.py", line 246 i = yield i ^ SyntaxError: invalid syntax [...] $ python -V Python 2.4.3 }}}

This is on my server, and prevents me from using the hg highlight extension because even though the sql lexer is not used it causes a traceback.

Comments (6)

  1. Christian Ebert reporter
    • changed status to open

    Not so fast ;-)

    I now get a different traceback:

    >>> from pygments.lexers import guess_lexer_for_filename
    >>> text = open('setup.py').read()[:1024]
    >>> guess_lexer_for_filename('setup.py', text)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "pygments/lexers/__init__.py", line 172, in guess_lexer_for_filename
        for lexer in _iter_lexerclasses():
      File "pygments/lexers/__init__.py", line 147, in _iter_lexerclasses
        _load_lexers(module_name)
      File "pygments/lexers/__init__.py", line 32, in _load_lexers
        mod = __import__(module_name, None, None, ['__all__'])
      File "pygments/lexers/other.py", line 22, in ?
        from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
      File "pygments/lexers/sql.py", line 174, in ?
        class PlPgsqlLexer(PostgresBase, RegexLexer):
      File "pygments/lexers/sql.py", line 185, in PlPgsqlLexer
        tokens = deepcopy(PostgresLexer.tokens)
      File "/usr/lib64/python2.4/copy.py", line 174, in deepcopy
        y = copier(x, memo)
      File "/usr/lib64/python2.4/copy.py", line 268, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python2.4/copy.py", line 174, in deepcopy
        y = copier(x, memo)
      File "/usr/lib64/python2.4/copy.py", line 241, in _deepcopy_list
        y.append(deepcopy(a, memo))
      File "/usr/lib64/python2.4/copy.py", line 174, in deepcopy
        y = copier(x, memo)
      File "/usr/lib64/python2.4/copy.py", line 248, in _deepcopy_tuple
        y.append(deepcopy(a, memo))
      File "/usr/lib64/python2.4/copy.py", line 204, in deepcopy
        y = _reconstruct(x, rv, 1, memo)
      File "/usr/lib64/python2.4/copy.py", line 336, in _reconstruct
        y = callable(*args)
      File "/usr/lib64/python2.4/copy_reg.py", line 92, in __newobj__
        return cls.__new__(cls, *args)
    TypeError: function() takes at least 2 arguments (0 given)
    >>>
    
  2. Log in to comment