#114 Exception as exc error with latest svn

closed-fixed
5
2010-04-08
2010-04-03
Douglas Calvert
No

Hello,
The follwing error occurs when I start gedit. The plugin is greyed out (not activatable?) in the list of plugins. From what I can tell the "exception as exc" line was introduced in revion 370...

2010-04-02 20:39:58,511 DEBUG resources - Initializing resource locating
/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/latex/actions.py:280: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/__init__.py", line 26, in <module>
from src import *
File "/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/__init__.py", line 32, in <module>
from base.decorators import GeditWindowDecorator
File "/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 33, in <module>
from config import UI, WINDOW_SCOPE_VIEWS, EDITOR_SCOPE_VIEWS, EDITORS, ACTIONS
File "/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/base/config.py", line 134, in <module>
from ..latex.actions import LaTeXMenuAction, LaTeXNewAction, LaTeXCommentAction, LaTeXPreviewAction, LaTeXSpellCheckAction, LaTeXChooseMasterAction, \ File "/home/dfc/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/latex/actions.py", line 280
except Exception as exc:
^
SyntaxError: invalid syntax

** (gedit:5798): WARNING **: Error loading plugin 'Gedit LaTeX Plugin 0.2 rc3'

Discussion

  • Please replace the line 280 in .gnome2/gedit/plugins/GeditLaTeXPlugin/src/latex/actions.py

    except Exception as exc:

    by

    except Exception, exc:

    (" as " becomes ", "). The symbol "as" became a keyword only in Python 2.6 and Python 3, the above syntax is not valid in Python 2.5.*. I will change this in the next revision. Thanks!

    You should also do this
    - at line 120 in ~/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/latex/views.py
    - at line 1189 in ~/.gnome2/gedit/plugins/GeditLaTeXPlugin/src/latex/livepreview.py

     
  • Done!

     
    • assigned_to: nobody --> yannickv
    • status: open --> closed-fixed