Explorar el Código

Update ceval.c

blueloveTH hace 7 meses
padre
commit
39958a92d2
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      src/interpreter/ceval.c

+ 4 - 1
src/interpreter/ceval.c

@@ -1303,7 +1303,10 @@ bool pk_stack_binaryop(VM* self, py_Name op, py_Name rop) {
         py_newbool(py_retval(), !res);
         return true;
     }
-    return TypeError("unsupported operand type(s) for '%s'", pk_op2str(op));
+
+    py_Type lhs_t = rop ? TOP()->type : SECOND()->type;
+    py_Type rhs_t = rop ? SECOND()->type : TOP()->type;
+    return TypeError("unsupported operand type(s) for '%s': '%t' and '%t'", pk_op2str(op), lhs_t, rhs_t);
 }
 
 bool py_binaryop(py_Ref lhs, py_Ref rhs, py_Name op, py_Name rop) {