mirror of
https://github.com/python/cpython.git
synced 2025-09-10 10:47:34 +00:00
bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958)
This commit is contained in:
parent
e56ab746a9
commit
edb13ae48c
3 changed files with 10 additions and 0 deletions
|
@ -190,6 +190,9 @@ class RegressionTests(unittest.TestCase):
|
|||
cur = Cursor(con)
|
||||
with self.assertRaises(sqlite.ProgrammingError):
|
||||
cur.execute("select 4+5").fetchall()
|
||||
with self.assertRaisesRegex(sqlite.ProgrammingError,
|
||||
r'^Base Cursor\.__init__ not called\.$'):
|
||||
cur.close()
|
||||
|
||||
def CheckStrSubclass(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue