Merge pull request #387 from tonal/master

Annotate type and set self.connection to None in MySQLResult.read as …
This commit is contained in:
INADA Naoki
2016-01-07 22:03:56 +09:00
2 changed files with 6 additions and 1 deletions

2
.gitignore vendored
View File

@@ -7,3 +7,5 @@ __pycache__
/.tox
/build
/pymysql/tests/databases.json
/.idea

View File

@@ -1267,6 +1267,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
@@ -1294,7 +1297,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