File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -439,17 +439,13 @@ def test_missing_protocol(self):
439439 with self .assertRaises (sqlite .ProgrammingError ):
440440 sqlite .adapt (1 , None )
441441
442- # TODO: RUSTPYTHON
443- @unittest .expectedFailure
444442 def test_defect_proto (self ):
445443 class DefectProto ():
446444 def __adapt__ (self ):
447445 return None
448446 with self .assertRaises (sqlite .ProgrammingError ):
449447 sqlite .adapt (1. , DefectProto )
450448
451- # TODO: RUSTPYTHON
452- @unittest .expectedFailure
453449 def test_defect_self_adapt (self ):
454450 class DefectSelfAdapt (float ):
455451 def __conform__ (self , _ ):
Original file line number Diff line number Diff line change @@ -695,7 +695,11 @@ mod _sqlite {
695695 }
696696 if let Ok ( adapter) = proto. get_attr ( "__adapt__" , vm) {
697697 match adapter. call ( ( obj, ) , vm) {
698- Ok ( val) => return Ok ( val) ,
698+ Ok ( val) => {
699+ if !vm. is_none ( & val) {
700+ return Ok ( val) ;
701+ }
702+ }
699703 Err ( exc) => {
700704 if !exc. fast_isinstance ( vm. ctx . exceptions . type_error ) {
701705 return Err ( exc) ;
@@ -705,7 +709,11 @@ mod _sqlite {
705709 }
706710 if let Ok ( adapter) = obj. get_attr ( "__conform__" , vm) {
707711 match adapter. call ( ( proto, ) , vm) {
708- Ok ( val) => return Ok ( val) ,
712+ Ok ( val) => {
713+ if !vm. is_none ( & val) {
714+ return Ok ( val) ;
715+ }
716+ }
709717 Err ( exc) => {
710718 if !exc. fast_isinstance ( vm. ctx . exceptions . type_error ) {
711719 return Err ( exc) ;
You can’t perform that action at this time.
0 commit comments