errno -- System error codes. ============================ .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/errno/__init__.pyi .. py:module:: errno .. autoapi-nested-parse:: 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 :term:`MicroPython port`. Attributes ---------- .. autoapisummary:: errno.EAGAIN errno.EEXIST errno.errorcode Module Contents --------------- .. py:data:: EAGAIN :type: _typeshed.Incomplete Error codes, based on ANSI C/POSIX standard. All error codes start with "E". As mentioned above, inventory of the codes depends on :term:`MicroPython port`. Errors are usually accessible as ``exc.errno`` where ``exc`` is an instance of `OSError`. Usage example:: try: os.mkdir("my_dir") except OSError as exc: if exc.errno == errno.EEXIST: print("Directory already exists") .. py:data:: EEXIST :type: _typeshed.Incomplete Error codes, based on ANSI C/POSIX standard. All error codes start with "E". As mentioned above, inventory of the codes depends on :term:`MicroPython port`. Errors are usually accessible as ``exc.errno`` where ``exc`` is an instance of `OSError`. Usage example:: try: os.mkdir("my_dir") except OSError as exc: if exc.errno == errno.EEXIST: print("Directory already exists") .. py:data:: errorcode :type: Dict Dictionary mapping numeric error codes to strings with symbolic error code (see above):: >>> print(errno.errorcode[errno.EEXIST]) EEXIST