From 63a72f58619a0f67cc42abc021f6ac97e2a5ee25 Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Tue, 28 Apr 2015 17:08:07 +0100 Subject: [PATCH] connections.py use int not atoi `atoi` is deprecated since python 2.0 and not in python 3. I guess this code is not being run since `_mysql.c` looks like it always defines `warning_count` anyway, but it should not sit around being python-3-incompatible. --- MySQLdb/connections.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index a84896e..7ac040b 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -325,10 +325,9 @@ class Connection(_mysql.connection): def warning_count(self): """Return the number of warnings generated from the last query. This is derived from the info() method.""" - from string import atoi info = self.info() if info: - return atoi(info.split()[-1]) + return int(info.split()[-1]) else: return 0