mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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.
This commit is contained in:
parent
df9ba3623a
commit
08d230a540
6 changed files with 36 additions and 8 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue