Converted to python3 and now using pymysql