forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Merge in MicroPython 1.13 #4720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 250 commits
Commits
Show all changes
1816 commits
Select commit
Hold shift + click to select a range
f03d030
powerpc/uart: Choose which UART to use at build time, not runtime.
shenki 5cfc09f
travis: For powerpc job, build both UART variants.
shenki 8f64267
tools/codeformat.py: Add verbose option to pass to uncrustify and black.
dlech 22806ed
extmod/vfs: Retain previous working directory if chdir fails.
dpgeorge 8897134
stm32/machine_uart: Retain attached-to-repl setting when init'ing UART.
dpgeorge 9ae50d2
stm32/machine_uart: Allow re-init'ing a static UART object.
dpgeorge 68d053c
stm32/modmachine: Allow changing AHB and APB bus frequencies on STM32WB.
dpgeorge 5210fc5
stm32/adc: Add support to pyb.ADC for STM32WB MCUs.
dpgeorge 0f7b5cc
stm32/machine_adc: Make setting of ADC1_COMMON->CCR clearer on STM32WB.
dpgeorge c8985d5
stm32/dma: Add support for DMA on STM32WB, with SPI settings provided.
dpgeorge 246f3f6
stm32/boards/xxx_WB55: Enable pyb.ADC and hardware SPI on WB55 boards.
dpgeorge a4086a2
qemu-arm/README: Update link to toolchain.
DavidSpickett da71f55
stm32/Makefile: Quote libgcc path so spaces are not an issue.
stinos 203b107
py/modbuiltins: Fix getattr to work with class raising AttributeError.
dpgeorge b2030e1
lib/utils/pyexec: Add missing MP_ERROR_TEXT when compiler disabled.
dpgeorge 8e591d4
minimal: Make build more flexible and work as 64-bit build.
dpgeorge e54626f
docs/reference: Add note about multiple exceptions when heap is locked.
andrewleech 02cc446
mimxrt: Add initial impl of machine.LED class, and basic pin support.
alphaFred e6881f0
extmod/modbluetooth: Make modbluetooth event not a bitfield.
jimmo 6a3c89d
extmod/modbluetooth: Add discover complete events for svc/char/desc.
jimmo 919d640
extmod/modbluetooth: Allow discovery of svc/char by uuid.
jimmo c07ea3e
extmod/modbluetooth: Implement read done event.
jimmo 9902ce1
tests/multi_bluetooth: Update to work with new BLE events.
jimmo 9708fe8
docs/library: Update ubluetooth for new events and discover by uuid.
jimmo 1cad63c
extmod/modbluetooth: Ensure status=0 always on success.
jimmo 8b7ae4e
extmod/modbluetooth: Support bigger characteristic values.
jimmo 834b482
examples/bluetooth: Fix incorrect value of BR/EDR flag in advertising.
jxltom 596fb73
qemu-arm: Support building in debug mode with DEBUG=1.
dpgeorge 621f40b
esp32/mpthreadport: Fix calculation of thread stack size.
dpgeorge eeca2c3
github: Add GitHub action to build docs.
dlech 1e6d18c
docs: Fix Sphinx 3.x warnings, and enable warnings-as-errors on build.
dlech 6ac05af
mimxrt/tusb_config.h: Preliminary fix for TinyUSB HS endpoint overflow.
alphaFred bd06c69
py/dynruntime.h: Make mp_obj_str_get_str raise if arg not a str/bytes.
dpgeorge 51fd6c9
extmod/ure: Use single function for match/search/sub.
stinos 8e8dcdd
esp32: Update IDF v4.0 supported hash to v4.0.1.
jimmo e0d539f
mimxrt/boards: Enable LED class for MIMXRT1060_EVK board.
Albort12138 29e2586
mimxrt/boards: Integrate support for MIMXRT1020_EVK board.
alphaFred 28370c0
py/objtype: Add __dict__ attribute for class objects.
pi-anl 95cbe6b
py/objtype: Use mp_obj_dict_copy() for creating obj.__dict__ attribute.
pi-anl f3062b5
py/obj.h: Clarify comments about mp_map_t is_fixed and is_ordered.
dpgeorge a4c96fb
extmod/uasyncio: Add asyncio.wait_for_ms function.
dpgeorge 3705bc4
extmod/modbluetooth: Register default GATT service and fix esp32 init.
jp-96 c6fd6a0
examples/bluetooth: Fix event code in ble_temperature_central.py.
jimmo 3f77f2c
unix/btstack_usb: Allow choosing adaptor via environment variable.
jimmo 00c3e21
tests/run-multitests.py: Allow passing unique env vars to each instance.
jimmo 2934e41
docs/esp8266: Add quickref documentation for UART on esp8266.
nickcrabtree 05e5d41
mimxrt/boards: Set __heap_size__ to 0 in MIMXRT1011.ld.
Albort12138 38b4f15
zephyr: Fix and rename stacks_analyze function in zephyr module.
MaureenHelm 8b061f2
zephyr: Fix floating point configuration.
MaureenHelm db02cb0
zephyr: Update for refactored zephyr device structures.
MaureenHelm 6aff27a
zephyr: Update to new zephyr timeout API.
MaureenHelm 4837b1c
zephyr: Convert DT_FLASH_AREA usages to new dts macros.
MaureenHelm b1651ff
zephyr: Increase minimum required cmake version to 3.13.1.
MaureenHelm 1ae8618
zephyr: Use cmake find_package to locate zephyr.
MaureenHelm 2b99003
stm32/boards/STM32F769DISC: Use macro instead of const for flash size.
dpgeorge 5093597
top: Update contribution and commit guide to include optional sign-off.
dpgeorge bd7c92e
tools/uncrustify.cfg: Remove deprecated sp_word_brace option.
dlech ecd7826
tools/codeformat.py: Remove sizeof fixup.
dlech b4d0d7b
tools/uncrustify: Update config for v0.71.0.
dlech 0fd91e3
py/compile: Convert scope test to SCOPE_IS_COMP_LIKE macro.
dpgeorge 1783950
py/compile: Implement PEP 572, assignment expressions with := operator.
dpgeorge 2c5993c
ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports.
dpgeorge e0fe8ea
tests/basics: Add tests for assignment operator :=.
dpgeorge a3c89cf
tests/cpydiff: Add CPy diff test for assignment expression behaviour.
dpgeorge 131b0de
py/grammar.h: Consolidate duplicate sub-rules for :test and =test.
dpgeorge f2e267d
py/compile: Implement PEP 526, syntax for variable annotations.
dpgeorge a51eef4
tests/basics: Add tests for variable annotations.
dpgeorge 1678f41
esp32/esp32_rmt: Extend RMT to support carrier feature.
da99e0f
stm32/factoryreset: Provide empty create-FS function when FAT disabled.
dpgeorge 289be6b
stm32/usb: Add support for 2xVCP on L0, L432 and WB MCUs.
dpgeorge 4b5dd01
stm32/rfcore: Leave txpower level as default when initialising rfcore.
dpgeorge 8d71cc2
nrf/bluetooth: Use MP_ERROR_TEXT for all error messages.
glennrub cba3e25
travis: Change nrf pca10056 board to build with soft-device enabled.
dpgeorge c521c17
github: Add FUNDING.yml file pointing to micropython GitHub sponsorship.
dpgeorge ce02d5e
stm32/boards/NUCLEO_WB55: Add more CPU pins and aliases to SW1/2/3.
dpgeorge 026fda6
tools/codeformat.py: Include extmod/{btstack,nimble} in code formatting.
dpgeorge 77ed6f6
tools/uncrustify: Enable more opts to remove space between func and '('.
dlech 3a9d948
esp32/esp32_rmt: Call rmt_driver_install before rmt_config.
jonathanhogg 6164c7e
py/misc.h: Add missing semi-colon in mp_float_union_t for big-endian.
dpgeorge f1ba2c9
qemu-arm/Makefile: Add CFLAGS_EXTRA to CFLAGS.
dpgeorge ac15be9
travis: Build qemu-arm with MP_ENDIANNESS_BIG=1 to test bigendian build.
dpgeorge 5f3c2f1
stm32/irq: Clean up irq.h so it does not depend on core uPy defines.
dpgeorge ce32669
stm32/powerctrlboot: Include irq.h to get definitions of IRQ priorities.
dpgeorge afd47d5
stm32/flash: Make flash C-API reusable, and funcs return an error code.
dpgeorge 4c8a68d
stm32/i2cslave: Add support for WB MCUs.
dpgeorge 736daeb
stm32/flash: Add flash_is_valid_addr, and extend sectors for 2MB F7.
dpgeorge a8778c8
stm32/mboot: Use flash routines from main stm32 code rather than custom.
dpgeorge 8675858
stm32/mboot: Use CMSIS system source code for SystemInit function.
dpgeorge 7057283
stm32/mboot: Add support for using mboot with WB MCUs.
dpgeorge 6f40e6e
stm32/boards: Add build-time option for NUCLEO_WB55 to use mboot.
dpgeorge 13ad1a4
travis: In stm32 job, build mboot for NUCLEO_WB55.
dpgeorge 81a7293
stm32/mboot: Set VTOR on start up to ensure it has the correct value.
dpgeorge b4dc4c5
stm32/mboot: Use additional CFLAGS to compile string0.c.
dpgeorge 456a3ab
py/obj.h: Add public mp_obj_is_dict_or_ordereddict() helper macro.
dpgeorge 7dd480a
extmod/moductypes: Use mp_obj_is_dict_or_ordereddict to simplify code.
dpgeorge 457fdf6
py/objtype: Support passing in an OrderedDict to type() as the locals.
dpgeorge 76faeed
tools/makemanifest.py: Support freezing a subdirectory recursively.
dpgeorge 0c77668
extmod/vfs_lfs: Fix littlefs bindings to build in nan-box mode.
dpgeorge eb9850e
stm32/mpconfigport.h: Enable PY_IO_FILEIO when any VFS is enabled.
dpgeorge c5af321
stm32/timer: Support TIM1 on WB MCUs.
dpgeorge 717b507
stm32/boards: Enable LFS2 on PYBD_SF3 and PYBD_SF6.
dpgeorge 763bd44
stm32/mboot: Don't search for firmware on FS, just attempt to open it.
dpgeorge 390f329
stm32/mboot: Decouple stream, filesystem and top-level loading code.
dpgeorge 67fd58b
stm32/mboot: Add support for littlefs.
dpgeorge 0a8ce0d
stm32/mboot: Update README to describe WB and littlefs support.
dpgeorge 6475cdb
travis: Build mboot for PYBV10 with LFS2 enabled in stm32 job.
dpgeorge 137df81
stm32/i2cslave: Pass I2C instance to callbacks to support multi I2Cs.
dpgeorge aa26fe6
py/asm: Add funcs/macros to emit machine code for logical-shift-right.
dpgeorge b3b8706
py/asm: Add condition codes for signed comparisons.
dpgeorge 41fa8b5
py/emitnative: Implement binary operations for viper uint operands.
dpgeorge 9f911d8
py/objcomplex: Add mp_obj_get_complex_maybe for use in complex bin-op.
dpgeorge e4fcd21
stm32/usbd_cdc_interface: Remove full==size-1 limitation on tx ringbuf.
pi-anl 048a1d6
stm32/timer: Properly initialise timer deadtime/brk on WB MCUs.
dpgeorge 4d6f60d
tools/pydfu.py: Respect longer timeouts requested by DFU device/mboot.
pi-anl 8bbaa20
stm32/mboot: Implement DFU mass erase.
pi-anl 4000681
stm32/flash: Update flash_get_sector_info to return -1 on invalid addr.
pi-anl 65a7e00
stm32/mboot: Add DFU logic to respond to DFU_GETSTATE request.
dpgeorge cb9aafb
docs/library: Clarify that the arg to esp.deepsleep is in microseconds.
victorhook b572aa5
docs/esp32: Add info about PWM duty cycle range to esp32 quickref.
spacemanspiff2007 9d5edb3
lib/utils: Protect all of mpirq.c with MICROPY_ENABLE_SCHEDULER.
dpgeorge f84145b
zephyr: Implement machine.Pin.irq() for setting callbacks on pin change.
dpgeorge 41b7734
zephyr/make-minimal: Disable FAT and LFS2 options to make it build.
dpgeorge d06ae1d
py/obj.h: Make existing MP_TYPE_FLAG_xxx macros sequential.
dpgeorge 332d833
py: Rework mp_convert_member_lookup to properly handle built-ins.
dpgeorge 95ec0de
stm32/mboot: Remove the use of timeout in DFU_GETSTATUS.
pi-anl 494bcad
stm32/mboot: Disable polling mode by default and use IRQ mode instead.
pi-anl 07f181a
Revert "tools/pydfu.py: Respect longer timeouts requested by DFU dev..."
pi-anl 27abac9
unix: Make manifest selection match other ports.
jimmo 4050281
unix: Enable uasyncio on dev variant.
jimmo 9dfb4ae
nrf/bluetooth/ble_uart: Fix implicit declaration of function.
glennrub fc1f22a
nrf/bluetooth: Handle data length update request.
glennrub ab0c14d
nrf/bluetooth/ble_uart: Add mp_hal_stdio_poll function.
glennrub 5996bf7
nrf/bluetooth/ble_uart: Fix random advertisement name.
glennrub f22f7b2
nrf/bluetooth/ble_uart: Swap end character on cooked strings.
glennrub c2317a3
nrf/Makefile: Disable ROM text compression when compiling for debug.
glennrub 15574cd
nrf: Add support for time.ticks_xxx functions using RTC1.
hoihu 59ed3bd
nrf: Enable nrf tick support on all boards by default.
hoihu f5dd46b
unix/variants: Enable VFS and all supported filesystems on dev variant.
dpgeorge 8594389
stm32/fdcan: Use the right FIFO to calc element address in can_receive.
iabdalkader 63b2eb2
stm32/fdcan: Use FDCAN_RXFxS_FxFL instead of hard-coded value.
iabdalkader d07073f
stm32/fdcan: Support maximum timeout of HAL_MAX_DELAY in can_receive.
iabdalkader c299cc9
stm32/pyb_can: Handle timeout arg for FDCAN in pyb_can_send.
iabdalkader b6146ca
extmod/nimble: Fix attr NULL ptr dereference in ble_gatt_attr_read_cb.
friebel f743bd3
nrf/boards: Add initial support for Actinius Icarus.
alextsam b776fe6
nrf/nrfx_config: Disable RTC2 for nRF9160 targets.
glennrub 95d0d1c
nrf/boards: Enable RTCounter machine module for nrf9160 boards.
glennrub 411e115
travis: Install newer toolchain for nrf job.
glennrub d9e8edc
travis: Add pca10090 build to nrf job.
glennrub 486cb6d
nrf: Add board definition for nRF52840-MDK-USB-Dongle.
pi-mst 342800c
travis: Change nrf pca10056 board to build with s140 SoftDevice.
glennrub 5d0be97
unix: Make the MICROPY_xxx_ATOMIC_SECTION mutex recursive.
jimmo 07aec46
examples/bluetooth: In ble_advertising.py, skip appearance if not set.
jimmo e152d0c
extmod/btstack: Schedule notify/indicate/write ops for bg completion.
jimmo 89a95b7
examples/bluetooth: Add simple UART demo with central and peripheral.
jimmo b769884
docs/library: Add gatts_indicate() doc to ubluetooth.rst.
jimmo 43ceada
extmod/modbluetooth: Ignore unused self_in in ble_gatts_indicate.
jimmo 3c7ca20
extmod/modbluetooth: Fix so it builds in peripheral-only mode.
jimmo 9d823a5
extmod/modbluetooth: Add event for "indicate acknowledgement".
jimmo c7f7c02
docs/library: For ubluetooth, add docs for _IRQ_GATTS_INDICATE_DONE.
jimmo 9aa2140
extmod/modussl: Improve exception error messages.
tve 98e5834
lib/libc: Add implementation of strncpy.
tve 3e758ef
lib/mbedtls_errors: Add code to patch mbedtls for shortened error strs.
tve 5264478
extmod/modussl_mbedtls: Integrate shorter error strings.
tve 7dbef53
esp32/esp32_rmt: Properly fix looping behaviour of RMT.
jonathanhogg 5f0e9d1
docs/library: Update documentation of esp32's RMT.
jonathanhogg 76fefad
esp32/network_lan: Add support for IP101 PHY.
kennethryerson f80b1d8
lib/stm32lib: Update library for H7 v1.6.0 and WB v1.6.0.
dpgeorge 895b1db
tests/basics: Split out memoryview slice-assign tests to separate file.
dpgeorge a853fff
py/obj.h: Fix mp_seq_replace_slice_no_grow to use memmove not memcpy.
dpgeorge 27767aa
lib/libm_dbl: Add round.c source code.
v923z d9b7261
lib/libc: Fix string0's implementation of strncpy.
dpgeorge 0a79e18
nrf: Split mpconfigport.h into multiple files.
glennrub caaaa2b
nrf: Enable more features for all targets.
glennrub cf9be20
docs/library: Update pyb.SPI init method to add descr about "ti" arg.
hlovatt 4a7c273
docs/library: Update pyb.Timer to add missing args and defaults to init.
hlovatt 47289f4
docs/library: Update pyb.UART to correct pyboard UART availability.
hlovatt fe7d479
docs/esp32: Fix machine.Timer quickref to specify HW timers.
nevercast 37e1b5c
py/compile: Don't await __aiter__ special method in async-for.
jonathanhogg fd2ff86
stm32/usbdev: Fix calculation of SCSI LUN size with multiple LUNs.
dpgeorge 441460d
extmod/uasyncio: Add StreamReader.readexactly(n) method.
dpgeorge 952de5c
tools/makemanifest.py: Use errno.EEXIST instead of number 17.
dpgeorge 0c0cef9
tests: Move .mpy import tests from import/ to micropython/ dir.
dpgeorge 8da40ba
tests/micropython: Improve .mpy import tests to run on more targets.
dpgeorge 9883d8e
py/persistentcode: Maintain root ptr list of imported native .mpy code.
dpgeorge b731bd0
tools/makemanifest.py: Print nicely formatted errors from mpy-cross.
dpgeorge 60f5b94
extmod/vfs_reader: Fix mp_reader_new_file to open file in "rb" mode.
dpgeorge ac94e06
zephyr: Include storage/flash_map.h unconditionally.
MaureenHelm 17689a7
travis: Add zephyr build to CI.
MaureenHelm e76c746
docs: Change `\*` to `*` in argument lists.
agniutkarsh 8727c4e
stm32/pin_defs_stm32: Fix pin printing to show IN mode correctly.
davehylands 60cf2c0
tools/pyboard.py: Replace eval() of received data with alternative.
mbuesch 492cf34
tools/mpy-tool.py: Fix offset of line number info.
mmilata 448319a
tools/makemanifest.py: Use os.makedirs to make path for generated files.
dpgeorge 5f9b105
py/runtime: Fix builtin compile() in "single" mode so it prints exprs.
dpgeorge 20948a3
tests/extmod: Add test for uasyncio.sleep of a negative time.
dpgeorge 55c76ea
extmod/uasyncio: Truncate negative sleeps to 0.
dpgeorge 9289935
unix/fatfs_port: Implement get_fattime.
dpgeorge badd351
lib/timeutils: Add helper functions to deal with nanosecs since 1970.
dpgeorge ee50a6e
py/mphal.h: Introduce mp_hal_time_ns and implement on various ports.
dpgeorge 2acc087
extmod/vfs_lfs: Add mtime support to littlefs files.
dpgeorge 3d9a7ed
extmod/btstack: Implement GAP scan duration_ms parameter.
jimmo 0bc2c1c
extmod/modbluetooth: Fix race between READ_REQUEST and other IRQs.
jimmo a80a146
extmod/bluetooth: Support active scanning in BLE.gap_scan().
pi-anl 5fb276d
tests/extmod: Make uasyncio_fair test more reliable by adjusting sleeps.
dpgeorge 91c5d16
nrf/Makefile: Improve user C modules support.
rcolistete 405893a
tests/run-tests: Use absolute paths where possible.
stinos 0c3f9d5
tests/run-tests: Make test output directory configurable.
stinos cef678b
extmod/machine_i2c: Fix buffer overrun if 'addrsize' is bigger than 32.
mbuesch a93a378
zephyr/README: Update required Zephyr version and mention new features.
dpgeorge 338b12d
LICENSE,docs: Update copyright year range to include 2020.
dpgeorge 40d174a
stm32/powerctrl.h: Include stdbool.h to get definition of bool.
dpgeorge 0c7354a
tests: Split out complex reverse-op tests to separate test file.
dpgeorge 0665907
all: Update Python code to conform to latest black formatting.
dpgeorge d1995e5
extmod/modlwip: Fix error return for TCP recv when not connected.
dpgeorge 836bca9
unix/variants: Fix fast and freedos variants so they build again.
dpgeorge 40153b8
esp32/mphalport: Fix mp_hal_time_ns offset.
dpgeorge c70e599
extmod/vfs: Support larger integer range in VFS stat time fields.
dpgeorge 0385b21
unix/modos: Support larger integer range in uos.stat fields.
dpgeorge 2a72e90
extmod/vfs: Add option to use 1970 as Epoch.
dpgeorge a909c21
unix/fatfs_port: Fix month offset in timestamp calculation.
dpgeorge 0e6ef40
tests/extmod: Add tests for verifying FAT and littlefs mtime values.
dpgeorge b0932fc
all: Bump version to 1.13.
dpgeorge f0bb26d
Merge MicroPython 1.13 into CircuitPython
tannewt 92d63b4
tests: Restore memoryview1 test to micropython version
jepler 2c0664e
slice: restore ability to construct a slice
jepler 0bef554
Fix framebuf_subclass test
jepler d0f6b32
Update bytecode
jepler c174bc4
Update to match our bytecode style
jepler 14e0bdb
Move mp_get_stream non-inline
jepler c3ce2ba
runtime: Remove unneeded includes
jepler 8fae7d2
runtime.c: Fix reading properties
jepler cdf220b
Fix ure tests
jepler f21c2bd
Update native skips to match micropython
jepler 607148b
Add frzqstr to coverage build
jepler 4054860
Name the variant like micropython does
jepler 68d4682
compile: Reserve labels for native await
jepler 2bcfe21
Add natmod examples
jepler eb4cf7a
Add natmod "features0" example
jepler 716a82b
set the coroutine generator for native generators
jepler 3dad2cb
Merge pull request #9 from jepler/1.13_test_fixes
tannewt c34ddf1
Switch from recommonmark to myst-parser
tannewt d8701e5
Update binary path
tannewt 7f2f8e2
Turn off CPython warnings in tests
tannewt 3fda0c0
Fix board builds and use MP_ERROR_TEXT in py and extmod
tannewt 59c2787
Fix esp32s2 build
tannewt 71d2536
Build fixes thanks to jepler
tannewt 42f4065
Merge remote-tracking branch 'adafruit/main' into merge_1.13
tannewt b19c1a3
mpy M -> C
tannewt cebb10d
Fixes from review
tannewt 5c73683
Fix esp32s2 builds after AP changes
tannewt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
:mod:`errno` -- system error codes | ||
:mod:`uerrno` -- system error codes | ||
=================================== | ||
|
||
.. module:: errno | ||
.. module:: uerrno | ||
tannewt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:synopsis: system error codes | ||
|
||
|see_cpython_module| :mod:`cpython:errno`. | ||
|see_cpython_module| :mod:`python:errno`. | ||
tannewt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This module provides access to symbolic error codes for `OSError` exception. | ||
A particular inventory of codes depends on :term:`MicroPython port`. | ||
|
||
Constants | ||
--------- | ||
|
||
.. data:: EEXIST, EAGAIN, etc. | ||
|
||
Error codes, based on ANSI C/POSIX standard. All error codes start with | ||
"E". Errors are usually accessible as ``exc.args[0]`` | ||
"E". As mentioned above, inventory of the codes depends on | ||
:term:`MicroPython port`. Errors are usually accessible as ``exc.args[0]`` | ||
where ``exc`` is an instance of `OSError`. Usage example:: | ||
|
||
try: | ||
os.mkdir("my_dir") | ||
uos.mkdir("my_dir") | ||
tannewt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
except OSError as exc: | ||
if exc.args[0] == errno.EEXIST: | ||
if exc.args[0] == uerrno.EEXIST: | ||
tannewt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
print("Directory already exists") | ||
|
||
.. data:: errorcode | ||
|
||
Dictionary mapping numeric error codes to strings with symbolic error | ||
code (see above):: | ||
|
||
>>> print(errno.errorcode[uerrno.EEXIST]) | ||
>>> print(uerrno.errorcode[uerrno.EEXIST]) | ||
tannewt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
EEXIST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.