diff --git a/Lib/test/test_sqlite3/test_types.py b/Lib/test/test_sqlite3/test_types.py index 53df08e99..623188235 100644 --- a/Lib/test/test_sqlite3/test_types.py +++ b/Lib/test/test_sqlite3/test_types.py @@ -433,8 +433,6 @@ class ObjectAdaptationTests(unittest.TestCase): with self.assertRaises(sqlite.ProgrammingError): sqlite.adapt(1.) # No float adapter registered - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_missing_protocol(self): with self.assertRaises(sqlite.ProgrammingError): sqlite.adapt(1, None) diff --git a/stdlib/src/sqlite.rs b/stdlib/src/sqlite.rs index 4e9620eea..c5b71eb67 100644 --- a/stdlib/src/sqlite.rs +++ b/stdlib/src/sqlite.rs @@ -732,7 +732,14 @@ mod _sqlite { alt: OptionalArg, vm: &VirtualMachine, ) -> PyResult { - // TODO: None proto + if matches!(proto, OptionalArg::Present(None)) { + return if let OptionalArg::Present(alt) = alt { + Ok(alt) + } else { + Err(new_programming_error(vm, "can't adapt".to_owned())) + }; + } + let proto = proto .flatten() .unwrap_or_else(|| PrepareProtocol::class(&vm.ctx).to_owned());