diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index bdab745de37..b123786db08 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -1452,8 +1452,6 @@ class DummyException(Exception): raise DummyException("reraised") - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_blob_closed(self): with memory_database() as cx: cx.execute("create table test(b blob)") diff --git a/stdlib/src/sqlite.rs b/stdlib/src/sqlite.rs index cc146b3786c..96c5bbebe39 100644 --- a/stdlib/src/sqlite.rs +++ b/stdlib/src/sqlite.rs @@ -2145,13 +2145,16 @@ mod _sqlite { } #[pymethod] - fn __enter__(zelf: PyRef) -> PyRef { - zelf + fn __enter__(zelf: PyRef, vm: &VirtualMachine) -> PyResult> { + let _ = zelf.inner(vm)?; + Ok(zelf) } #[pymethod] - fn __exit__(&self, _args: FuncArgs) { - self.close() + fn __exit__(&self, _args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> { + let _ = self.inner(vm)?; + self.close(); + Ok(()) } fn inner(&self, vm: &VirtualMachine) -> PyResult> {