summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-06-20 21:07:31 (GMT)
committerGitHub <noreply@github.com>2021-06-20 21:07:31 (GMT)
commitccc95c7b4799570c2d7e4de3d579860ad833e1f8 (patch)
tree104878b17d4c6038fb1eba697be9de393a65b4d1 /Lib/sqlite3
parent28fe0159f59a761bf52c1999c8f7cb12d0d12562 (diff)
downloadcpython-ccc95c7b4799570c2d7e4de3d579860ad833e1f8.zip
cpython-ccc95c7b4799570c2d7e4de3d579860ad833e1f8.tar.gz
cpython-ccc95c7b4799570c2d7e4de3d579860ad833e1f8.tar.bz2
[3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) (GH-26816)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/dbapi.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 39c9bf5..0716e65 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -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):