diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2022-11-07 12:55:31 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-11-08 23:09:22 +1100 |
| commit | 2c8dab7ab4ec0884c6428afc613d9dcc322d8c6d (patch) | |
| tree | 59add53a83983398bf59c82a71b78532f6ccadca /tests/micropython/viper_addr.py | |
| parent | f8b0ae32d31cfb95db4294c43b821c205c17e1d3 (diff) | |
py/objarray: Detect bytearray(str) without an encoding.
This prevents a very subtle bug caused by writing e.g. `bytearray('\xfd')`
which gives you `(0xc3, 0xbd)`.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tests/micropython/viper_addr.py')
| -rw-r--r-- | tests/micropython/viper_addr.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/micropython/viper_addr.py b/tests/micropython/viper_addr.py index 84bc6c002..8e79fadb2 100644 --- a/tests/micropython/viper_addr.py +++ b/tests/micropython/viper_addr.py @@ -21,7 +21,7 @@ def memsum(src: ptr8, n: int) -> int: # create array and get its address -ar = bytearray("0000") +ar = bytearray(b"0000") addr = get_addr(ar) print(type(ar)) print(type(addr)) |
