Skip to content

Commit

Permalink
fix some more translate()s
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Oct 30, 2023
1 parent 8c444ef commit eacb0c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/ndarray_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,19 +863,19 @@ mp_obj_t ndarray_binary_logical(ndarray_obj_t *lhs, ndarray_obj_t *rhs,

#if ULAB_SUPPORTS_COMPLEX
if((lhs->dtype == NDARRAY_COMPLEX) || (rhs->dtype == NDARRAY_COMPLEX) || (lhs->dtype == NDARRAY_FLOAT) || (rhs->dtype == NDARRAY_FLOAT)) {
mp_raise_TypeError(translate("operation not supported for the input types"));
mp_raise_TypeError(MP_ERROR_TEXT("operation not supported for the input types"));
}
#else
if((lhs->dtype == NDARRAY_FLOAT) || (rhs->dtype == NDARRAY_FLOAT)) {
mp_raise_TypeError(translate("operation not supported for the input types"));
mp_raise_TypeError(MP_ERROR_TEXT("operation not supported for the input types"));
}
#endif

// bail out, if both inputs are of 16-bit types, but differ in sign;
// numpy promotes the result to int32
if(((lhs->dtype == NDARRAY_INT16) && (rhs->dtype == NDARRAY_UINT16)) ||
((lhs->dtype == NDARRAY_UINT16) && (rhs->dtype == NDARRAY_INT16))) {
mp_raise_TypeError(translate("dtype of int32 is not supported"));
mp_raise_TypeError(MP_ERROR_TEXT("dtype of int32 is not supported"));
}

ndarray_obj_t *results = NULL;
Expand Down

0 comments on commit eacb0c9

Please sign in to comment.