diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index b123786db0..7a16f75655 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -1744,8 +1744,6 @@ def progress(): pass with self.assertRaises(sqlite.ProgrammingError): con.set_progress_handler(progress, 100) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_closed_call(self): con = sqlite.connect(":memory:") con.close() diff --git a/stdlib/src/sqlite.rs b/stdlib/src/sqlite.rs index 0ee3f43f17..964da64bcf 100644 --- a/stdlib/src/sqlite.rs +++ b/stdlib/src/sqlite.rs @@ -852,10 +852,14 @@ mod _sqlite { } impl Callable for Connection { - type Args = (PyUtf8StrRef,); + type Args = FuncArgs; fn call(zelf: &Py, args: Self::Args, vm: &VirtualMachine) -> PyResult { - if let Some(stmt) = Statement::new(zelf, args.0, vm)? { + let _ = zelf.db_lock(vm)?; + + let (sql,): (PyUtf8StrRef,) = args.bind(vm)?; + + if let Some(stmt) = Statement::new(zelf, sql, vm)? { Ok(stmt.into_ref(&vm.ctx).into()) } else { Ok(vm.ctx.none())