File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -433,8 +433,6 @@ def test_missing_adapter(self):
433433 with self .assertRaises (sqlite .ProgrammingError ):
434434 sqlite .adapt (1. ) # No float adapter registered
435435
436- # TODO: RUSTPYTHON
437- @unittest .expectedFailure
438436 def test_missing_protocol (self ):
439437 with self .assertRaises (sqlite .ProgrammingError ):
440438 sqlite .adapt (1 , None )
Original file line number Diff line number Diff line change @@ -732,7 +732,14 @@ mod _sqlite {
732732 alt : OptionalArg < PyObjectRef > ,
733733 vm : & VirtualMachine ,
734734 ) -> PyResult {
735- // TODO: None proto
735+ if matches ! ( proto, OptionalArg :: Present ( None ) ) {
736+ return if let OptionalArg :: Present ( alt) = alt {
737+ Ok ( alt)
738+ } else {
739+ Err ( new_programming_error ( vm, "can't adapt" . to_owned ( ) ) )
740+ } ;
741+ }
742+
736743 let proto = proto
737744 . flatten ( )
738745 . unwrap_or_else ( || PrepareProtocol :: class ( & vm. ctx ) . to_owned ( ) ) ;
You can’t perform that action at this time.
0 commit comments