Fixed incompatibility with recent MySQLdb update