Python 程序报错 AttributeError: 'NoneType' object has no attribute 'commit'

Python 程序执行错误
AttributeError: 'NoneType' object has no attribute 'commit'

运行
Python 2.7.5
Mysql 5.7
CentOS 7.2

看你的代码,其中有一个 xxx.commit
这里 xxx 不是一个有效的对象实例

代码贴出来啊,
你的问题肯定是对象不存在。为啥对象不存在,贴出代码再看看