Browse Source

unix: Enable MICROPY_PY_STR_BYTES_CMP_WARN.

Also, fix a warning text (remove "duplicate" BytesWarning).
pull/2254/head
Paul Sokolovsky 8 years ago
parent
commit
918851e836
  1. 2
      py/obj.c
  2. 1
      unix/mpconfigport.h

2
py/obj.c

@ -199,7 +199,7 @@ bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
str_cmp_err: str_cmp_err:
#if MICROPY_PY_STR_BYTES_CMP_WARN #if MICROPY_PY_STR_BYTES_CMP_WARN
if (MP_OBJ_IS_TYPE(o1, &mp_type_bytes) || MP_OBJ_IS_TYPE(o2, &mp_type_bytes)) { 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 #endif
return false; return false;

1
unix/mpconfigport.h

@ -138,6 +138,7 @@
// names in exception messages (may require more RAM). // names in exception messages (may require more RAM).
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
#define MICROPY_WARNINGS (1) #define MICROPY_WARNINGS (1)
#define MICROPY_PY_STR_BYTES_CMP_WARN (1)
// Define to 1 to use undertested inefficient GC helper implementation // Define to 1 to use undertested inefficient GC helper implementation
// (if more efficient arch-specific one is not available). // (if more efficient arch-specific one is not available).

Loading…
Cancel
Save