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):
433
433
with self .assertRaises (sqlite .ProgrammingError ):
434
434
sqlite .adapt (1. ) # No float adapter registered
435
435
436
- # TODO: RUSTPYTHON
437
- @unittest .expectedFailure
438
436
def test_missing_protocol (self ):
439
437
with self .assertRaises (sqlite .ProgrammingError ):
440
438
sqlite .adapt (1 , None )
Original file line number Diff line number Diff line change @@ -732,7 +732,14 @@ mod _sqlite {
732
732
alt : OptionalArg < PyObjectRef > ,
733
733
vm : & VirtualMachine ,
734
734
) -> 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
+
736
743
let proto = proto
737
744
. flatten ( )
738
745
. unwrap_or_else ( || PrepareProtocol :: class ( & vm. ctx ) . to_owned ( ) ) ;
You can’t perform that action at this time.
0 commit comments