Skip to content

Commit 918851e

Browse files
committed
unix: Enable MICROPY_PY_STR_BYTES_CMP_WARN.
Also, fix a warning text (remove "duplicate" BytesWarning).
1 parent a1b442b commit 918851e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

py/obj.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
199199
str_cmp_err:
200200
#if MICROPY_PY_STR_BYTES_CMP_WARN
201201
if (MP_OBJ_IS_TYPE(o1, &mp_type_bytes) || MP_OBJ_IS_TYPE(o2, &mp_type_bytes)) {
202-
mp_warning("BytesWarning: Comparison between bytes and str");
202+
mp_warning("Comparison between bytes and str");
203203
}
204204
#endif
205205
return false;

unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
// names in exception messages (may require more RAM).
139139
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
140140
#define MICROPY_WARNINGS (1)
141+
#define MICROPY_PY_STR_BYTES_CMP_WARN (1)
141142

142143
// Define to 1 to use undertested inefficient GC helper implementation
143144
// (if more efficient arch-specific one is not available).

0 commit comments

Comments
 (0)