summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml23
-rw-r--r--.github/workflows/create_website_pr.yml4
-rw-r--r--.gitmodules2
-rw-r--r--conf.py14
-rw-r--r--docs/library/network.rst2
-rw-r--r--ports/atmel-samd/boards/nfc_copy_cat/board.c38
-rw-r--r--ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h51
-rw-r--r--ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk14
-rw-r--r--ports/atmel-samd/boards/nfc_copy_cat/pins.c20
-rw-r--r--ports/litex/boards/fomu/fomu-spi.ld40
-rw-r--r--ports/mimxrt10xx/common-hal/busio/SPI.c17
-rw-r--r--shared-bindings/ulab/__init__.rst2
-rw-r--r--shared-module/displayio/Display.c1
-rw-r--r--tests/basics/dict1.py2
-rw-r--r--tests/basics/exception1.py1
-rw-r--r--tests/basics/gen_yield_from.py.exp14
-rw-r--r--tests/basics/gen_yield_from_close.py.exp20
-rw-r--r--tests/basics/gen_yield_from_throw.py.exp6
-rw-r--r--tests/basics/generator_close.py.exp10
-rw-r--r--tests/basics/generator_return.py2
-rw-r--r--tests/basics/int_big_error.py4
-rw-r--r--tests/basics/parser.py.exp3
-rw-r--r--tests/basics/python34.py6
-rw-r--r--tests/basics/python34.py.exp1
-rw-r--r--tests/basics/set_pop.py2
-rw-r--r--tests/basics/subclass_native3.py4
-rw-r--r--tests/basics/try_as_var.py2
-rw-r--r--tests/import/import_override.py.exp2
-rw-r--r--tests/misc/sys_exc_info.py2
-rw-r--r--tools/hid_report_descriptors.py4
30 files changed, 271 insertions, 42 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8f9d03d00..e8156727b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -16,15 +16,15 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- - name: Set up Python 3.5
+ - name: Set up Python 3.8
uses: actions/setup-python@v1
with:
- python-version: 3.5
+ python-version: 3.8
- name: Install deps
run: |
sudo apt-get install -y eatmydata
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64
- pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml
+ pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml
- name: Versions
run: |
gcc --version
@@ -42,7 +42,7 @@ jobs:
make -C ports/unix -j2
make -C ports/unix coverage -j2
- name: Test all
- run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1
+ run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1
working-directory: tests
- name: Print failure info
run: |
@@ -54,10 +54,10 @@ jobs:
working-directory: tests
if: failure()
- name: Native Tests
- run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native
+ run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native
working-directory: tests
- name: mpy Tests
- run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
+ run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
working-directory: tests
- name: Docs
run: sphinx-build -E -W -b html . _build/html
@@ -189,6 +189,7 @@ jobs:
- "mini_sam_m4"
- "monster_m4sk"
- "ndgarage_ndbit6"
+ - "nfc_copy_cat"
- "nucleo_f767zi"
- "nucleo_h743zi_2"
- "ohs2020_badge"
@@ -246,10 +247,10 @@ jobs:
- "xinabox_cs11"
steps:
- - name: Set up Python 3.5
+ - name: Set up Python 3.8
uses: actions/setup-python@v1
with:
- python-version: 3.5
+ python-version: 3.8
- name: Install deps
run: |
sudo apt-get install -y gettext
@@ -292,10 +293,10 @@ jobs:
- "fomu"
steps:
- - name: Set up Python 3.5
+ - name: Set up Python 3.8
uses: actions/setup-python@v1
with:
- python-version: 3.5
+ python-version: 3.8
- name: Install deps
run: |
sudo apt-get install -y gettext
@@ -326,4 +327,4 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
+ if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file
diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml
index 69ca8f12b..963fadd3d 100644
--- a/.github/workflows/create_website_pr.yml
+++ b/.github/workflows/create_website_pr.yml
@@ -12,10 +12,10 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- - name: Set up Python 3.5
+ - name: Set up Python 3.8
uses: actions/setup-python@v1
with:
- python-version: 3.5
+ python-version: 3.8
- name: Install deps
run: |
pip install requests sh click
diff --git a/.gitmodules b/.gitmodules
index 5c3387077..365d9ff72 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -109,7 +109,7 @@
url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git
[submodule "extmod/ulab"]
path = extmod/ulab
- url = https://github.com/v923z/micropython-ulab/
+ url = https://github.com/v923z/micropython-ulab
[submodule "frozen/Adafruit_CircuitPython_ESP32SPI"]
path = frozen/Adafruit_CircuitPython_ESP32SPI
url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
diff --git a/conf.py b/conf.py
index 6f0cd8b03..2e503737c 100644
--- a/conf.py
+++ b/conf.py
@@ -17,7 +17,7 @@ import json
import sys
import os
-from recommonmark.parser import CommonMarkParser
+import recommonmark
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -55,16 +55,20 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.coverage',
'rstjinja',
- 'c2rst'
+ 'c2rst',
+ 'recommonmark',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
# The suffix of source filenames.
-source_suffix = ['.rst', '.md', '.c', '.h']
+source_suffix = {
+ '.rst': 'restructuredtext',
+ '.md': 'markdown',
+ '.c': ''
+}
-source_parsers = {'.md': CommonMarkParser}
# The encoding of source files.
#source_encoding = 'utf-8-sig'
@@ -358,4 +362,4 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None),
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
def setup(app):
- app.add_stylesheet("customstyle.css")
+ app.add_css_file("customstyle.css")
diff --git a/docs/library/network.rst b/docs/library/network.rst
index cdcc5f323..bd32267fe 100644
--- a/docs/library/network.rst
+++ b/docs/library/network.rst
@@ -247,7 +247,7 @@ Methods
nic.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
.. method:: wlan.config('param')
-.. method:: wlan.config(param=value, ...)
+ wlan.config(param=value, ...)
Get or set general network interface parameters. These methods allow to work
with additional parameters beyond standard IP configuration (as dealt with by
diff --git a/ports/atmel-samd/boards/nfc_copy_cat/board.c b/ports/atmel-samd/boards/nfc_copy_cat/board.c
new file mode 100644
index 000000000..c8e20206a
--- /dev/null
+++ b/ports/atmel-samd/boards/nfc_copy_cat/board.c
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "boards/board.h"
+
+void board_init(void)
+{
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h
new file mode 100644
index 000000000..3790d23ff
--- /dev/null
+++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h
@@ -0,0 +1,51 @@
+#define MICROPY_HW_BOARD_NAME "Electronic Cats NFC Copy Cat"
+#define MICROPY_HW_MCU_NAME "samd21e18"
+
+#define MICROPY_HW_LED_STATUS (&pin_PA14)
+
+#define MICROPY_PORT_A (0)
+#define MICROPY_PORT_B (0)
+#define MICROPY_PORT_C (0)
+
+#define SPI_FLASH_MOSI_PIN &pin_PA08
+#define SPI_FLASH_MISO_PIN &pin_PA11
+#define SPI_FLASH_SCK_PIN &pin_PA09
+#define SPI_FLASH_CS_PIN &pin_PA10
+
+// No microcontroller.nvm
+#define CIRCUITPY_INTERNAL_NVM_SIZE 0
+
+#define DEFAULT_SPI_BUS_SCK (&pin_PA17)
+#define DEFAULT_SPI_BUS_MOSI (&pin_PA16)
+#define DEFAULT_SPI_BUS_MISO (&pin_PA19)
+
+#define IGNORE_PIN_PA03 1
+#define IGNORE_PIN_PA20 1
+#define IGNORE_PIN_PA21 1
+// USB is always used.
+#define IGNORE_PIN_PA24 1
+#define IGNORE_PIN_PA25 1
+#define IGNORE_PIN_PA30 1
+#define IGNORE_PIN_PA31 1
+#define IGNORE_PIN_PB01 1
+#define IGNORE_PIN_PB02 1
+#define IGNORE_PIN_PB03 1
+#define IGNORE_PIN_PB04 1
+#define IGNORE_PIN_PB05 1
+#define IGNORE_PIN_PB06 1
+#define IGNORE_PIN_PB07 1
+#define IGNORE_PIN_PB08 1
+#define IGNORE_PIN_PB09 1
+#define IGNORE_PIN_PB10 1
+#define IGNORE_PIN_PB11 1
+#define IGNORE_PIN_PB12 1
+#define IGNORE_PIN_PB13 1
+#define IGNORE_PIN_PB14 1
+#define IGNORE_PIN_PB15 1
+#define IGNORE_PIN_PB16 1
+#define IGNORE_PIN_PB17 1
+#define IGNORE_PIN_PB22 1
+#define IGNORE_PIN_PB23 1
+#define IGNORE_PIN_PB30 1
+#define IGNORE_PIN_PB31 1
+#define IGNORE_PIN_PB00 1
diff --git a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk
new file mode 100644
index 000000000..4f6d1e70d
--- /dev/null
+++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk
@@ -0,0 +1,14 @@
+USB_VID = 0x1209
+USB_PID = 0xBAB8
+USB_PRODUCT = "NFC Copy Cat"
+USB_MANUFACTURER = "Electronic Cats"
+
+CHIP_VARIANT = SAMD21E18A
+CHIP_FAMILY = samd21
+
+SPI_FLASH_FILESYSTEM = 1
+EXTERNAL_FLASH_DEVICE_COUNT = 1
+EXTERNAL_FLASH_DEVICES = "GD25Q16C"
+LONGINT_IMPL = NONE
+
+CIRCUITPY_SMALL_BUILD = 1
diff --git a/ports/atmel-samd/boards/nfc_copy_cat/pins.c b/ports/atmel-samd/boards/nfc_copy_cat/pins.c
new file mode 100644
index 000000000..ebe6e89e4
--- /dev/null
+++ b/ports/atmel-samd/boards/nfc_copy_cat/pins.c
@@ -0,0 +1,20 @@
+#include "shared-bindings/board/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA02) }, // IRQ
+ { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, // IN_A
+ { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, // IN_B
+ { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA05) }, // LED
+ { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA04) }, // LED
+ { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) }, // LED
+ { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PA27) }, // Switch
+ { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_PA28) }, // Switch
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) },
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) },
+ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) },
+ { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) },
+ { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) },
+ { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA18) }, // CS
+ { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
+};
+MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld
index 161ba607b..486c3cad1 100644
--- a/ports/litex/boards/fomu/fomu-spi.ld
+++ b/ports/litex/boards/fomu/fomu-spi.ld
@@ -26,8 +26,42 @@ SECTIONS
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
- *(.itcm.*) /* Instruction Tightly Coupled Memory */
- *(.dtcm_data.*) /* Data Tightly Coupled Memory */
+ *(.itcm.*) /* Instruction Tightly Coupled Memory */
+ *(.dtcm_data.*) /* Data Tightly Coupled Memory */
+
+ *(.text.cmp_lfn)
+ *(.text.qstr_find_strn)
+ *(.text.dcd_edpt_xfer)
+ *(.text.pop_rule)
+ *(.text.ff_wtoupper)
+ *(.text.dir_find)
+ *(.text.push_rule)
+ *(.text.csr_writel)
+ *(.text.csr_readl)
+ *(.text.timer0_ev_pending_write)
+ *(.text.autoreload_tick)
+ *(.text.filesystem_tick)
+ *(.text.usb_background)
+
+ *(.text.dcd_*)
+ *(.text.tud_control_*)
+ *(.text.tud_cdc_n_write_flush)
+ *(.text.tud_task)
+ *(.text.tu_edpt_dir)
+ *(.text.tu_fifo_empty)
+ *(.text.usbd_edpt_busy)
+ *(.text.irq_getmask)
+ *(.text.irq_setmask)
+ *(.text.irq_pending)
+ *(.text._osal_q_lock)
+ *(.text.osal_queue_receive)
+
+ *(.text.mp_obj_get_type)
+ *(.text.mp_parse)
+ *(.text.parse_compile_execute)
+ *(.text.mp_map_lookup)
+ *(.text.mp_execute_bytecode) /* Note: this function is 7kb */
+
*(.ramtext) /* .text* sections (code) */
*(.ramtext*) /* .text* sections (code) */
*(.data) /* .data sections */
@@ -63,7 +97,7 @@ SECTIONS
_sbss = .; /* define a global symbol at bss start; used by startup code */
*(.bss)
*(.bss*)
- *(.dtcm_bss.*) /* Data Tightly Coupled Memory */
+ *(.dtcm_bss.*) /* Data Tightly Coupled Memory */
*(.sbss)
*(.sbss*)
*(COMMON)
diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c
index b262d1a46..24a6dbff6 100644
--- a/ports/mimxrt10xx/common-hal/busio/SPI.c
+++ b/ports/mimxrt10xx/common-hal/busio/SPI.c
@@ -210,6 +210,18 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) {
+
+ LPSPI_Enable(self->spi, false);
+ uint32_t tcrPrescaleValue;
+ self->baudrate = LPSPI_MasterSetBaudRate(self->spi, baudrate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue);
+ LPSPI_Enable(self->spi, true);
+
+ if ((polarity == common_hal_busio_spi_get_polarity(self)) &&
+ (phase == common_hal_busio_spi_get_phase(self)) &&
+ (bits == ((self->spi->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT)) + 1) {
+ return true;
+ }
+
lpspi_master_config_t config = { 0 };
LPSPI_MasterGetDefaultConfig(&config);
@@ -221,11 +233,6 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
LPSPI_Deinit(self->spi);
LPSPI_MasterInit(self->spi, &config, LPSPI_MASTER_CLK_FREQ);
- LPSPI_Enable(self->spi, false);
- uint32_t tcrPrescaleValue;
- self->baudrate = LPSPI_MasterSetBaudRate(self->spi, config.baudRate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue);
- LPSPI_Enable(self->spi, true);
-
return true;
}
diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst
index 1379e56f3..d8c10dcc8 100644
--- a/shared-bindings/ulab/__init__.rst
+++ b/shared-bindings/ulab/__init__.rst
@@ -126,7 +126,7 @@ Array type codes
Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array`
-.. attribute:: uint8
+.. attribute:: uint16
Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array`
diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c
index 820fbcce6..2edded927 100644
--- a/shared-module/displayio/Display.c
+++ b/shared-module/displayio/Display.c
@@ -69,6 +69,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
self->auto_brightness = auto_brightness;
self->first_manual_refresh = !auto_refresh;
self->data_as_commands = data_as_commands;
+ self->backlight_on_high = backlight_on_high;
self->native_frames_per_second = native_frames_per_second;
self->native_ms_per_frame = 1000 / native_frames_per_second;
diff --git a/tests/basics/dict1.py b/tests/basics/dict1.py
index 20fa9def3..0cec51173 100644
--- a/tests/basics/dict1.py
+++ b/tests/basics/dict1.py
@@ -27,7 +27,7 @@ print({1:1} == {2:1})
try:
{}[0]
except KeyError as er:
- print('KeyError', er, repr(er), er.args)
+ print('KeyError', er, er.args)
# unsupported unary op
try:
diff --git a/tests/basics/exception1.py b/tests/basics/exception1.py
index 739dd3275..d83764cb9 100644
--- a/tests/basics/exception1.py
+++ b/tests/basics/exception1.py
@@ -1,7 +1,6 @@
print(repr(IndexError()))
print(str(IndexError()))
-print(repr(IndexError("foo")))
print(str(IndexError("foo")))
a = IndexError(1, "test", [100, 200])
diff --git a/tests/basics/gen_yield_from.py.exp b/tests/basics/gen_yield_from.py.exp
new file mode 100644
index 000000000..507f2b9ca
--- /dev/null
+++ b/tests/basics/gen_yield_from.py.exp
@@ -0,0 +1,14 @@
+here1
+3
+here2
+[1, 2]
+here1
+None
+here2
+[1, 2]
+here1
+123
+here2
+[1, 2]
+444
+[0, 1, 2]
diff --git a/tests/basics/gen_yield_from_close.py.exp b/tests/basics/gen_yield_from_close.py.exp
new file mode 100644
index 000000000..a44d1353d
--- /dev/null
+++ b/tests/basics/gen_yield_from_close.py.exp
@@ -0,0 +1,20 @@
+-1
+1
+StopIteration
+-1
+1
+2
+leaf caught GeneratorExit and swallowed it
+delegating caught GeneratorExit
+StopIteration
+-1
+1
+2
+leaf caught GeneratorExit and raised StopIteration instead
+delegating caught GeneratorExit
+StopIteration
+123
+RuntimeError
+0
+1
+close
diff --git a/tests/basics/gen_yield_from_throw.py.exp b/tests/basics/gen_yield_from_throw.py.exp
new file mode 100644
index 000000000..6ce97ad86
--- /dev/null
+++ b/tests/basics/gen_yield_from_throw.py.exp
@@ -0,0 +1,6 @@
+1
+got ValueError from upstream!
+str1
+got TypeError from downstream!
+123
+got StopIteration from downstream!
diff --git a/tests/basics/generator_close.py.exp b/tests/basics/generator_close.py.exp
new file mode 100644
index 000000000..fcd583935
--- /dev/null
+++ b/tests/basics/generator_close.py.exp
@@ -0,0 +1,10 @@
+None
+StopIteration
+1
+None
+StopIteration
+[1, 2]
+None
+StopIteration
+None
+ValueError
diff --git a/tests/basics/generator_return.py b/tests/basics/generator_return.py
index a3ac88575..5814ce837 100644
--- a/tests/basics/generator_return.py
+++ b/tests/basics/generator_return.py
@@ -7,4 +7,4 @@ print(next(g))
try:
print(next(g))
except StopIteration as e:
- print(repr(e))
+ print(type(e), e.args)
diff --git a/tests/basics/int_big_error.py b/tests/basics/int_big_error.py
index e036525d1..79809aef1 100644
--- a/tests/basics/int_big_error.py
+++ b/tests/basics/int_big_error.py
@@ -17,9 +17,9 @@ try:
except TypeError:
print("TypeError")
-# overflow because rhs of >> is being converted to machine int
+# overflow because arg of bytearray is being converted to machine int
try:
- 1 >> i
+ bytearray(i)
except OverflowError:
print('OverflowError')
diff --git a/tests/basics/parser.py.exp b/tests/basics/parser.py.exp
new file mode 100644
index 000000000..4d9886a09
--- /dev/null
+++ b/tests/basics/parser.py.exp
@@ -0,0 +1,3 @@
+SyntaxError
+SyntaxError
+SyntaxError
diff --git a/tests/basics/python34.py b/tests/basics/python34.py
index 36531f11c..4030db143 100644
--- a/tests/basics/python34.py
+++ b/tests/basics/python34.py
@@ -1,4 +1,4 @@
-# tests that differ when running under Python 3.4 vs 3.5/3.6
+# tests that differ when running under Python 3.4 vs 3.5/3.6/3.7
try:
exec
@@ -36,3 +36,7 @@ test_syntax("del ()") # can't delete empty tuple (in 3.6 we can)
import sys
print(sys.version[:3])
print(sys.version_info[0], sys.version_info[1])
+
+# from basics/exception1.py
+# in 3.7 no comma is printed if there is only 1 arg (in 3.4-3.6 one is printed)
+print(repr(IndexError("foo")))
diff --git a/tests/basics/python34.py.exp b/tests/basics/python34.py.exp
index 590fc364f..848017130 100644
--- a/tests/basics/python34.py.exp
+++ b/tests/basics/python34.py.exp
@@ -11,3 +11,4 @@ SyntaxError
SyntaxError
3.4
3 4
+IndexError('foo',)
diff --git a/tests/basics/set_pop.py b/tests/basics/set_pop.py
index 5e1196c9f..e951ca593 100644
--- a/tests/basics/set_pop.py
+++ b/tests/basics/set_pop.py
@@ -15,4 +15,4 @@ while s:
print(s.pop()) # last pop() should trigger the optimisation
for i in range(N):
s.add(i) # check that we can add the numbers back to the set
-print(list(s))
+print(sorted(s))
diff --git a/tests/basics/subclass_native3.py b/tests/basics/subclass_native3.py
index bd99ab0d6..6745b77bb 100644
--- a/tests/basics/subclass_native3.py
+++ b/tests/basics/subclass_native3.py
@@ -7,12 +7,12 @@ print(repr(e))
print(e.args)
try:
- raise MyExc("Some error")
+ raise MyExc("Some error", 1)
except MyExc as e:
print("Caught exception:", repr(e))
try:
- raise MyExc("Some error2")
+ raise MyExc("Some error2", 2)
except Exception as e:
print("Caught exception:", repr(e))
diff --git a/tests/basics/try_as_var.py b/tests/basics/try_as_var.py
index 0a92f1cae..4f02f9c10 100644
--- a/tests/basics/try_as_var.py
+++ b/tests/basics/try_as_var.py
@@ -1,7 +1,7 @@
try:
raise ValueError(534)
except ValueError as e:
- print(repr(e))
+ print(type(e), e.args)
# Var bound in except block is automatically deleted
try:
diff --git a/tests/import/import_override.py.exp b/tests/import/import_override.py.exp
new file mode 100644
index 000000000..365248da6
--- /dev/null
+++ b/tests/import/import_override.py.exp
@@ -0,0 +1,2 @@
+import import1b None 0
+456
diff --git a/tests/misc/sys_exc_info.py b/tests/misc/sys_exc_info.py
index 4bb2c61e8..bf9438e46 100644
--- a/tests/misc/sys_exc_info.py
+++ b/tests/misc/sys_exc_info.py
@@ -9,7 +9,7 @@ def f():
print(sys.exc_info()[0:2])
try:
- 1/0
+ raise ValueError('value', 123)
except:
print(sys.exc_info()[0:2])
f()
diff --git a/tools/hid_report_descriptors.py b/tools/hid_report_descriptors.py
index 92c962d59..07ed26744 100644
--- a/tools/hid_report_descriptors.py
+++ b/tools/hid_report_descriptors.py
@@ -68,9 +68,9 @@ def keyboard_hid_descriptor(report_id):
0x81, 0x02, # Input (Data, Variable, Absolute)
0x81, 0x01, # Input (Constant)
0x19, 0x00, # Usage Minimum (0)
- 0x29, 101, # Usage Maximum (101)
+ 0x29, 0xDD, # Usage Maximum (221)
0x15, 0x00, # Logical Minimum (0)
- 0x25, 101, # Logical Maximum (101)
+ 0x25, 0xDD, # Logical Maximum (221)
0x75, 0x08, # Report Size (8)
0x95, 0x06, # Report Count (6)
0x81, 0x00, # Input (Data, Array)