diff options
| author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-06-20 23:07:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-20 22:07:31 +0100 |
| commit | ccc95c7b4799570c2d7e4de3d579860ad833e1f8 (patch) | |
| tree | 104878b17d4c6038fb1eba697be9de393a65b4d1 /Lib/sqlite3 | |
| parent | 28fe0159f59a761bf52c1999c8f7cb12d0d12562 (diff) | |
| download | cpython-git-ccc95c7b4799570c2d7e4de3d579860ad833e1f8.tar.gz | |
[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.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 39c9bf5b61..0716e656a7 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): |
