From 67983e7519f519cf54d196175ff1a9027399a941 Mon Sep 17 00:00:00 2001 From: "Alexandr N Zamaraev (aka tonal)" Date: Fri, 23 Oct 2015 13:18:13 +0600 Subject: [PATCH 1/2] Annotate type and set self.connection to None in MySQLResult.read as other methods --- .gitignore | 2 ++ pymysql/connections.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 236fc37..86e9a68 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ __pycache__ /.tox /build /pymysql/tests/databases.json + +/.idea diff --git a/pymysql/connections.py b/pymysql/connections.py index 5cdea41..19b44fc 100644 --- a/pymysql/connections.py +++ b/pymysql/connections.py @@ -1117,6 +1117,9 @@ class Connection(object): class MySQLResult(object): def __init__(self, connection): + """ + @type connection: Connection + """ self.connection = connection self.affected_rows = None self.insert_id = None @@ -1144,7 +1147,7 @@ class MySQLResult(object): else: self._read_result_packet(first_packet) finally: - self.connection = False + self.connection = None def init_unbuffered_query(self): self.unbuffered_active = True From eea29eb34b3c85b5344641ac009f2b69ee75107b Mon Sep 17 00:00:00 2001 From: "Alexandr N Zamaraev (aka tonal)" Date: Fri, 23 Oct 2015 15:39:33 +0600 Subject: [PATCH 2/2] Annotate syntax --- pymysql/connections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymysql/connections.py b/pymysql/connections.py index 19b44fc..7a17123 100644 --- a/pymysql/connections.py +++ b/pymysql/connections.py @@ -1118,7 +1118,7 @@ class MySQLResult(object): def __init__(self, connection): """ - @type connection: Connection + :type connection: Connection """ self.connection = connection self.affected_rows = None