summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/fun_code_micropython.py
blob: 2c319a2db8c75e36a6a0700d2a6855e2d811dde4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Test MicroPython-specific restrictions of function.__code__ attribute.

try:
    (lambda: 0).__code__
except AttributeError:
    print("SKIP")
    raise SystemExit


def f_with_children():
    def g():
        pass


# Can't access __code__ when function has children.
try:
    f_with_children.__code__
except AttributeError:
    print("AttributeError")