Add some garbage for Django 1.11 compatibility (#327)

Django touched private area of this library.
Removing unused variables broke Django.

While Django 2.0 fixed it, Django 1.11 doesn't fix it
because it is in security-only fix mode.

So add unused variables for Django 1.11 compatibility.
They will be removed in next minor release.

Fix #303, #306
This commit is contained in:
Inada Naoki
2019-02-07 18:05:40 +09:00
committed by GitHub
parent c29d166023
commit 1f6e18d345
2 changed files with 21 additions and 2 deletions

View File

@ -63,6 +63,14 @@ class BaseCursor(object):
self.rowcount = -1
self.arraysize = 1
self._executed = None
# XXX THIS IS GARBAGE: While this is totally garbage and private,
# Django 1.11 depends on it. And they don't fix it because
# they are in security-only fix mode.
# So keep this garbage for now. This will be removed in 1.5.
# See PyMySQL/mysqlclient-python#303
self._last_executed = None
self.lastrowid = None
self.messages = []
self._result = None
@ -305,6 +313,7 @@ class BaseCursor(object):
self._do_get_result(db)
self._post_get_result()
self._executed = q
self._last_executed = q # XXX THIS IS GARBAGE: See above.
return self.rowcount
def _fetch_row(self, size=1):