summaryrefslogtreecommitdiffstatshomepage
path: root/tests/cpydiff/modules_struct_whitespace_in_format.py
blob: a7a1d2facdffff7e5ffc5ef2a2ae37459667ce29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""
categories: Modules,struct
description: Struct pack with whitespace in format, whitespace ignored by CPython, error on uPy
cause: MicroPython is optimised for code size.
workaround: Don't use spaces in format strings.
"""

import struct

try:
    print(struct.pack("b b", 1, 2))
    print("Should have worked")
except:
    print("struct.error")