|
板凳

楼主 |
发表于 2019-7-7 22:57:29
|
只看该作者
You are running your code with Python 3.x, but your code scheme for try.. except section is for Python 2.X.
If you want to run your code with Python 3.x, then change this line:
except MySQLdb.Error, e:
To:
except MySQLdb.Error as e:
And if you want this section of code works with Python 2.x and also Python 3.x, then change it to:
except MySQLdb.Error:
e = sys.exc_info()[1] |
|