Skip to content

Commit 20f59e1

Browse files
committed
py: Make mp_const_empty_bytes globally available.
1 parent b1e2172 commit 20f59e1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

py/obj.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,12 @@ extern const mp_obj_type_t mp_type_ZeroDivisionError;
350350
#define mp_const_none ((mp_obj_t)&mp_const_none_obj)
351351
#define mp_const_false ((mp_obj_t)&mp_const_false_obj)
352352
#define mp_const_true ((mp_obj_t)&mp_const_true_obj)
353+
#define mp_const_empty_bytes ((mp_obj_t)&mp_const_empty_bytes_obj)
353354
#define mp_const_empty_tuple ((mp_obj_t)&mp_const_empty_tuple_obj)
354355
extern const struct _mp_obj_none_t mp_const_none_obj;
355356
extern const struct _mp_obj_bool_t mp_const_false_obj;
356357
extern const struct _mp_obj_bool_t mp_const_true_obj;
358+
extern const struct _mp_obj_str_t mp_const_empty_bytes_obj;
357359
extern const struct _mp_obj_tuple_t mp_const_empty_tuple_obj;
358360
extern const struct _mp_obj_ellipsis_t mp_const_ellipsis_obj;
359361
extern const struct _mp_obj_exception_t mp_const_MemoryError_obj;

py/objstr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "objlist.h"
4343

4444
STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, mp_uint_t n_args, const mp_obj_t *args, mp_obj_t dict);
45-
const mp_obj_t mp_const_empty_bytes;
4645

4746
mp_obj_t mp_obj_new_str_iterator(mp_obj_t str);
4847
STATIC mp_obj_t mp_obj_new_bytes_iterator(mp_obj_t str);
@@ -1763,8 +1762,7 @@ const mp_obj_type_t mp_type_bytes = {
17631762
};
17641763

17651764
// the zero-length bytes
1766-
STATIC const mp_obj_str_t empty_bytes_obj = {{&mp_type_bytes}, 0, 0, NULL};
1767-
const mp_obj_t mp_const_empty_bytes = (mp_obj_t)&empty_bytes_obj;
1765+
const mp_obj_str_t mp_const_empty_bytes_obj = {{&mp_type_bytes}, 0, 0, NULL};
17681766

17691767
mp_obj_t mp_obj_str_builder_start(const mp_obj_type_t *type, mp_uint_t len, byte **data) {
17701768
mp_obj_str_t *o = m_new_obj(mp_obj_str_t);

0 commit comments

Comments
 (0)