File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1029,8 +1029,6 @@ def test_get(self):
10291029 self .assertIsNone (view .get ('xxx' ))
10301030 self .assertEqual (view .get ('xxx' , 42 ), 42 )
10311031
1032- # TODO: RUSTPYTHON
1033- @unittest .expectedFailure
10341032 def test_missing (self ):
10351033 class dictmissing (dict ):
10361034 def __missing__ (self , key ):
Original file line number Diff line number Diff line change @@ -83,9 +83,12 @@ impl PyMappingProxy {
8383 default : OptionalArg ,
8484 vm : & VirtualMachine ,
8585 ) -> PyResult < Option < PyObjectRef > > {
86- let default = default. into_option ( ) ;
87- let value = self . get_inner ( key, vm) ?. or ( default) ;
88- Ok ( value)
86+ let obj = self . to_object ( vm) ?;
87+ Ok ( Some ( vm. call_method (
88+ & obj,
89+ "get" ,
90+ ( key, default. unwrap_or_none ( vm) ) ,
91+ ) ?) )
8992 }
9093
9194 #[ pymethod( magic) ]
You can’t perform that action at this time.
0 commit comments