Skip to content
Snippets Groups Projects
Select Git revision
  • e6560754a5d41ddc01815ee06f10367d39af2367
  • master default protected
  • fix-warnings
  • tvbgone-fixes
  • genofire/ble-follow-py
  • schneider/ble-stability-new-phy-adv
  • schneider/ble-stability
  • msgctl/gfx_rle
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
36 results

board.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    gen_yield_from_throw.py 578 B
    def gen():
        try:
            yield 1
        except ValueError:
            print("got ValueError from upstream!")
        yield "str1"
        raise TypeError
    
    def gen2():
        print((yield from gen()))
    
    g = gen2()
    print(next(g))
    print(g.throw(ValueError))
    try:
        print(next(g))
    except TypeError:
        print("got TypeError from downstream!")
    
    # case where generator doesn't intercept the thrown/injected exception
    def gen3():
        yield 123
        yield 456
            
    g3 = gen3()
    print(next(g3))
    try:
        g3.throw(StopIteration)
    except StopIteration:
        print('got StopIteration from downstream!')