Updates for CircuitPython 9.x

This commit is contained in:
Daniel James 2023-10-30 20:53:26 -07:00
parent f9d3ec5027
commit 1309235cd8
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -302,7 +302,7 @@ STATIC void srv_txt_cb(struct mdns_service *service, void *ptr) {
for (size_t i = 0; i < self->num_txt_records; i++) {
res = mdns_resp_add_service_txtitem(service, self->txt_records[i], strlen(self->txt_records[i]));
if (res != ERR_OK) {
mp_raise_RuntimeError(translate("Failed to add service TXT record"));
mp_raise_RuntimeError(MP_ERROR_TEXT("Failed to add service TXT record"));
return;
}
}

View File

@ -212,7 +212,7 @@ STATIC mp_obj_t mdns_server_advertise_service(mp_uint_t n_args, const mp_obj_t *
for (size_t i = 0; i < num_txt_records; i++) {
mp_obj_t txt_record = mp_obj_subscr(txt_records, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL);
if (!mp_obj_is_str_or_bytes(txt_record)) {
mp_raise_ValueError(translate("Failed to add service TXT record; non-string or bytes found in txt_records"));
mp_raise_ValueError(MP_ERROR_TEXT("Failed to add service TXT record; non-string or bytes found in txt_records"));
}
txt_records_array[i] = mp_obj_str_get_str(txt_record);
}