Search code examples
pythonpython-3.xcode-intelligence

CodeIntel2: can it be used under Py3?


I try to run simple test py-file under Py3k, with CodeIntel2 lib. Package is suitable for SublimeText 2 and 3, so i guess lib is ok for Py3k.

I get this error on importing manager.py:

File "g:\_CodeIntel\serverwork.py", line 12, in <module>
  from codeintel2.manager import Manager
File "g:\_CodeIntel\libs\codeintel2\manager.py", line 287
  except CodeIntelError, ex:
                       ^
SyntaxError: invalid syntax

Can this er be fixed easily?


Solution

  • Python 3 has a slightly different format for exception handling. Notice the as below:

    try:
        1/0
    except ZeroDivisionError as e:
        print(e)
    

    Emits:

    division by zero