Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97372:ff4600cfa35e
Date: 2019-09-03 20:29 +0200
http://bitbucket.org/pypy/pypy/changeset/ff4600cfa35e/
Log: _sqlite.Cursor: add relevant part of __check_cursor to close()
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -746,6 +746,8 @@
self.__initialized = True
def close(self):
+ if not self.__initialized:
+ raise ProgrammingError("Base Cursor.__init__ not called.")
self.__connection._check_thread()
self.__connection._check_closed()
if self.__statement:
@@ -1043,6 +1045,7 @@
return list(self)
def __get_connection(self):
+ self.__check_cursor()
return self.__connection
connection = property(__get_connection)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit