@@ -620,20 +620,28 @@ impl VirtualMachine {
620620 } )
621621 }
622622
623- pub fn _lt ( & mut self , a : & PyObjectRef , b : PyObjectRef ) -> PyResult {
624- self . call_method ( a, "__lt__" , vec ! [ b] )
623+ pub fn _lt ( & mut self , a : PyObjectRef , b : PyObjectRef ) -> PyResult {
624+ self . call_or_unsupported ( a, b, "__lt__" , "__lt__" , |vm, a, b| {
625+ Err ( vm. new_unsupported_operand_error ( a, b, "<" ) )
626+ } )
625627 }
626628
627- pub fn _le ( & mut self , a : & PyObjectRef , b : PyObjectRef ) -> PyResult {
628- self . call_method ( a, "__le__" , vec ! [ b] )
629+ pub fn _le ( & mut self , a : PyObjectRef , b : PyObjectRef ) -> PyResult {
630+ self . call_or_unsupported ( a, b, "__le__" , "__le__" , |vm, a, b| {
631+ Err ( vm. new_unsupported_operand_error ( a, b, "<=" ) )
632+ } )
629633 }
630634
631- pub fn _gt ( & mut self , a : & PyObjectRef , b : PyObjectRef ) -> PyResult {
632- self . call_method ( a, "__gt__" , vec ! [ b] )
635+ pub fn _gt ( & mut self , a : PyObjectRef , b : PyObjectRef ) -> PyResult {
636+ self . call_or_unsupported ( a, b, "__gt__" , "__gt__" , |vm, a, b| {
637+ Err ( vm. new_unsupported_operand_error ( a, b, ">" ) )
638+ } )
633639 }
634640
635- pub fn _ge ( & mut self , a : & PyObjectRef , b : PyObjectRef ) -> PyResult {
636- self . call_method ( a, "__ge__" , vec ! [ b] )
641+ pub fn _ge ( & mut self , a : PyObjectRef , b : PyObjectRef ) -> PyResult {
642+ self . call_or_unsupported ( a, b, "__ge__" , "__ge__" , |vm, a, b| {
643+ Err ( vm. new_unsupported_operand_error ( a, b, ">=" ) )
644+ } )
637645 }
638646}
639647
0 commit comments