summaryrefslogtreecommitdiff
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-05-22 11:02:49 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-05-22 11:02:49 +0300
commit7bc6483a733e3f7884318221df9886928e97203a (patch)
treee9fdca067af119af0d828bbfe94c15f33abd2c6a /Lib/sqlite3
parentb0edb5e3086cb3ad2acb34f2a082e4ed41e381a3 (diff)
downloadcpython-7bc6483a733e3f7884318221df9886928e97203a.tar.gz
Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/factory.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 98dcae5d6c..a8348b4626 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -162,6 +162,14 @@ class RowFactoryTests(unittest.TestCase):
self.assertEqual(list(reversed(row)), list(reversed(as_tuple)))
self.assertIsInstance(row, Sequence)
+ def CheckFakeCursorClass(self):
+ # Issue #24257: Incorrect use of PyObject_IsInstance() caused
+ # segmentation fault.
+ class FakeCursor(str):
+ __class__ = sqlite.Cursor
+ cur = self.con.cursor(factory=FakeCursor)
+ self.assertRaises(TypeError, sqlite.Row, cur, ())
+
def tearDown(self):
self.con.close()