[3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) (GH-26816)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This commit is contained in:
Erlend Egeberg Aasland 2021-06-20 23:07:31 +02:00 committed by GitHub
parent 28fe0159f5
commit ccc95c7b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -92,6 +92,11 @@ class ModuleTests(unittest.TestCase):
sqlite.enable_shared_cache(enable)
self.assertIn("dbapi.py", cm.filename)
def test_disallow_instantiation(self):
cx = sqlite.connect(":memory:")
tp = type(cx("select 1"))
self.assertRaises(TypeError, tp)
class ConnectionTests(unittest.TestCase):