From c6a2320e876354ee62cf8149b849bcff9492d38a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 26 Jun 2019 03:16:24 +0200 Subject: bpo-37406: sqlite3 raises TypeError for wrong operation type (GH-14386) The sqlite3 module now raises TypeError, rather than ValueError, if operation argument type is not str: execute(), executemany() and calling a connection. --- Lib/sqlite3/test/dbapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/sqlite3/test/dbapi.py') diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 7c259d2af41..be11337154b 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -230,7 +230,7 @@ class CursorTests(unittest.TestCase): """) def CheckExecuteWrongSqlArg(self): - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): self.cu.execute(42) def CheckExecuteArgInt(self): @@ -377,7 +377,7 @@ class CursorTests(unittest.TestCase): self.cu.executemany("insert into test(income) values (?)", mygen()) def CheckExecuteManyWrongSqlArg(self): - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): self.cu.executemany(42, [(3,)]) def CheckExecuteManySelect(self): -- cgit v1.2.3