I have some relatively simple code that is even 'referenced in the 2.7' site:
try:
# Execute the SQL command
cur.execute(query)
# Fetch all the rows in a list of lists.
con.commit()
result = cur.fetchall()
except Exception as e:
con.rollback()
print("Error: unable to fecth data: {0}".format(e.strerror))
Using "as" is referenced here:
http://docs.python.org/2/tutorial/errors.html
pychecker fails this check with:
Processing module capture (capture.py)...
SyntaxError: invalid syntax (capture.py, line 78)
except Exception as e:
^
Warnings...
capture:1: NOT PROCESSED UNABLE TO IMPORT
[kpeters@localhost dbcontrol]$ /usr/local/bin/pychecker capture.py
Processing module capture (capture.py)...
SyntaxError: invalid syntax (capture.py, line 78)
except Exception as e:
^
Warnings...
capture:1: NOT PROCESSED UNABLE TO IMPORT
This cannot be right. Is this a bug?