From 918851e8365d0dac79eb2fa370c22f12379ff458 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 22 Jul 2016 00:52:07 +0300 Subject: [PATCH] unix: Enable MICROPY_PY_STR_BYTES_CMP_WARN. Also, fix a warning text (remove "duplicate" BytesWarning). --- py/obj.c | 2 +- unix/mpconfigport.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/py/obj.c b/py/obj.c index db4dd770fc..d6ce3dae6a 100644 --- a/py/obj.c +++ b/py/obj.c @@ -199,7 +199,7 @@ bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) { str_cmp_err: #if MICROPY_PY_STR_BYTES_CMP_WARN if (MP_OBJ_IS_TYPE(o1, &mp_type_bytes) || MP_OBJ_IS_TYPE(o2, &mp_type_bytes)) { - mp_warning("BytesWarning: Comparison between bytes and str"); + mp_warning("Comparison between bytes and str"); } #endif return false; diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 30441c9fd2..b5c65f7cfd 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -138,6 +138,7 @@ // names in exception messages (may require more RAM). #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED) #define MICROPY_WARNINGS (1) +#define MICROPY_PY_STR_BYTES_CMP_WARN (1) // Define to 1 to use undertested inefficient GC helper implementation // (if more efficient arch-specific one is not available).