File: _debugger_case_source_mapping.py

package info (click to toggle)
pydevd 3.3.0%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,892 kB
  • sloc: python: 77,508; cpp: 1,869; sh: 368; makefile: 50; ansic: 4
file content (31 lines) | stat: -rw-r--r-- 691 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def full_function():
    # Note that this function is not called, it's there just to make the mapping explicit.
    a = 1  # map to cEll1, line 2
    b = 2  # map to cEll1, line 3

    c = 3  # map to cEll2, line 2
    d = 4  # map to cEll2, line 3


def create_code():
    cell1_code = compile(''' # line 1
a = 1  # line 2
b = 2  # line 3
''', '<cEll1>', 'exec')

    cell2_code = compile('''# line 1
c = 3  # line 2
d = 4  # line 3
''', '<cEll2>', 'exec')

    return {'cEll1': cell1_code, 'cEll2': cell2_code}


if __name__ == '__main__':
    code = create_code()
    exec(code['cEll1'])
    exec(code['cEll1'])

    exec(code['cEll2'])
    exec(code['cEll2'])
    print('TEST SUCEEDED')