Skip to content
Snippets Groups Projects
Select Git revision
  • fc28ffb4ac1230bb932d63fa285a8fb09eb67fd4
  • main default protected
  • phhw
  • captouch-threshold
  • t
  • dos
  • test2
  • test
  • slewtest
  • simtest
  • view-think
  • vm-pending
  • media-buf
  • scope
  • passthrough
  • wave
  • vsync
  • dos-main-patch-50543
  • json-error
  • rahix/big-flow3r
  • pippin/media_framework
  • v1.3.0
  • v1.2.0
  • v1.2.0+rc1
  • v1.1.1
  • v1.1.0
  • v1.1.0+rc1
  • v1.0.0
  • v1.0.0+rc6
  • v1.0.0+rc5
  • v1.0.0+rc4
  • v1.0.0+rc3
  • v1.0.0+rc2
  • v1.0.0+rc1
34 results

badge23_mp_hardware.c

Blame
  • Forked from flow3r / flow3r 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!')