summaryrefslogtreecommitdiff
path: root/py/mperrno.h
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2018-11-12 16:16:47 +0100
committerNoralf Trønnes <noralf@tronnes.org>2018-11-13 22:04:44 +0100
commitc5aa2e93001436f6d63e3e9b7dff3c535397db1c (patch)
tree99c25b5cefc5d6ff2c3e41ef820295d595c86fc2 /py/mperrno.h
parent50f5d27c436cf71d14bf893709375e5bcf62717b (diff)
Support OSError attributes
This adds support for the OSError attributes : errno, strerror, filename and filename2. CPython only sets errno if 2 arguments has been passed in. This has not been implemented here. CPython OSError.args is capped at 2 items for backward compatibility reasons. This has not been implemented here. MICROPY_CPYTHON_COMPAT has to be enabled to get these attributes. mp_common_errno_to_str() has been extended to check mp_errno_to_str() as well. This is done to ease reuse for the strerror argument.
Diffstat (limited to 'py/mperrno.h')
-rw-r--r--py/mperrno.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/py/mperrno.h b/py/mperrno.h
index 876b090b5..911a9b413 100644
--- a/py/mperrno.h
+++ b/py/mperrno.h
@@ -141,7 +141,6 @@
#endif
const char* mp_errno_to_str(mp_obj_t errno_val);
-// For commonly encountered errors, return compressed human readable strings
-const compressed_string_t* mp_common_errno_to_str(mp_obj_t errno_val);
+const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len);
#endif // MICROPY_INCLUDED_PY_MPERRNO_H