<s> import threading <EOL> import traceback , sys <EOL> def exc ( ) : <EOL> <NUM_LIT:1> / <NUM_LIT:0> <EOL> def G ( ) : <EOL> traceback . print_stack ( limit = <NUM_LIT:2> ) <EOL> yield <NUM_LIT:1> <EOL> traceback . print_stack ( limit = <NUM_LIT:2> ) <EOL> yield <NUM_LIT:2> <EOL> exc ( ) <EOL> def f1 ( x ) : <EOL> print x . next ( ) <EOL> def f2 ( x ) : <EOL> print x . next ( ) <EOL> def f3 ( x ) : <EOL> try : <EOL> print x . next ( ) <EOL> except : <EOL> print "<STR_LIT>" <EOL> traceback . print_tb ( sys . exc_info ( ) [ <NUM_LIT:2> ] ) <EOL> def run ( nthreads = <NUM_LIT:4> ) : <EOL> g = G ( ) <EOL> def t ( f ) : <EOL> return threading . Thread ( target = f , args = ( g , ) ) <EOL> for t in [ t ( f1 ) , t ( f2 ) , t ( f3 ) ] : <EOL> t . start ( ) <EOL> t . join ( ) <EOL> run ( ) </s>
