mirror of
https://github.com/m5stack/M5Stack_MicroPython.git
synced 2026-05-20 10:14:44 -07:00
'Ctrl+D' on empty line now performs full ESP32 soft reset 'math' module updated, added 'factorial' method 'uos' module updated, added 'mpycore' method to show MicroPython core git commit hash and date
35 lines
996 B
ReStructuredText
35 lines
996 B
ReStructuredText
:mod:`uerrno` -- system error codes
|
|
===================================
|
|
|
|
.. module:: uerrno
|
|
:synopsis: system error codes
|
|
|
|
|see_cpython_module| :mod:`python:errno`.
|
|
|
|
This module provides access to symbolic error codes for `OSError` exception.
|
|
A particular inventory of codes depends on `MicroPython port`.
|
|
|
|
Constants
|
|
---------
|
|
|
|
.. data:: EEXIST, EAGAIN, etc.
|
|
|
|
Error codes, based on ANSI C/POSIX standard. All error codes start with
|
|
"E". As mentioned above, inventory of the codes depends on
|
|
`MicroPython port`. Errors are usually accessible as ``exc.args[0]``
|
|
where ``exc`` is an instance of `OSError`. Usage example::
|
|
|
|
try:
|
|
uos.mkdir("my_dir")
|
|
except OSError as exc:
|
|
if exc.args[0] == uerrno.EEXIST:
|
|
print("Directory already exists")
|
|
|
|
.. data:: errorcode
|
|
|
|
Dictionary mapping numeric error codes to strings with symbolic error
|
|
code (see above)::
|
|
|
|
>>> print(uerrno.errorcode[uerrno.EEXIST])
|
|
EEXIST
|