Merge pull request #6376 from dhalbert/errno-messages

Correct errno messages
This commit is contained in:
Dan Halbert 2022-05-10 15:51:00 -04:00 committed by GitHub
commit 78695f528b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -1749,6 +1749,10 @@ msgstr ""
msgid "No space left on device"
msgstr ""
#: py/moduerrno.c
msgid "No such device"
msgstr ""
#: py/moduerrno.c
msgid "No such file/directory"
msgstr ""
@ -1856,6 +1860,10 @@ msgstr ""
msgid "Only one color can be transparent at a time"
msgstr ""
#: py/moduerrno.c
msgid "Operation not permitted"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
msgid "Operation or feature not supported"
msgstr ""
@ -2521,10 +2529,6 @@ msgstr ""
msgid "Unsupported format"
msgstr ""
#: py/moduerrno.c
msgid "Unsupported operation"
msgstr ""
#: ports/espressif/common-hal/dualbank/__init__.c
msgid "Update Failed"
msgstr ""

View File

@ -140,7 +140,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) {
const compressed_string_t *desc = NULL;
switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) {
case EPERM:
desc = MP_ERROR_TEXT("Permission denied");
desc = MP_ERROR_TEXT("Operation not permitted");
break;
case ENOENT:
desc = MP_ERROR_TEXT("No such file/directory");
@ -155,7 +155,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) {
desc = MP_ERROR_TEXT("File exists");
break;
case ENODEV:
desc = MP_ERROR_TEXT("Unsupported operation");
desc = MP_ERROR_TEXT("No such device");
break;
case EINVAL:
desc = MP_ERROR_TEXT("Invalid argument");