#NEWLINE# def getFrameGuardLightCode( code_identifier , codes , parent_exception_exit , parent_return_exit , frame_exception_exit , frame_return_exit , provider , emit , context ) : #NEWLINE# #INDENT# context . markAsNeedsExceptionVariables ( ) #NEWLINE# assert ( frame_exception_exit is not None ) #NEWLINE# if context . getOwner ( ) . isExpressionGeneratorObjectBody ( ) : #NEWLINE# #INDENT# kind = 'generator' #NEWLINE# template = template_frame_guard_generator #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kind = 'coroutine' #NEWLINE# template = template_frame_guard_coroutine #NEWLINE# #UNINDENT# context . addFrameDeclaration ( ( template_frame_guard_cache_decl % { #NEWLINE# #INDENT# 'frame_identifier' : ( 'frame_' + kind ) , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# no_exception_exit = context . allocateLabel ( 'frame_no_exception' ) #NEWLINE# emit ( ( codes % { #NEWLINE# #INDENT# 'frame_cache_identifier' : ( 'cache_frame_' + kind ) , #NEWLINE# 'code_identifier' : code_identifier , #NEWLINE# 'codes' : indented ( codes , 0 ) , #NEWLINE# 'module_identifier' : getModuleAccessCode ( context = context ) , #NEWLINE# 'no_exception_exit' : no_exception_exit , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# if ( frame_return_exit is not None ) : #NEWLINE# #INDENT# emit ( ( template_frame_guard_generator_return_handler % { #NEWLINE# #INDENT# 'frame_identifier' : ( '%s->m_frame' % kind ) , #NEWLINE# 'return_exit' : parent_return_exit , #NEWLINE# 'frame_return_exit' : frame_return_exit , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# ( frame_locals_name , locals_code ) = getFrameLocalsUpdateCode ( provider = provider , context = context ) #NEWLINE# if ( kind == 'generator' ) : #NEWLINE# #INDENT# template = template_frame_guard_generator_exception_handler #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# template = template_frame_guard_generator_exception_handler #NEWLINE# #UNINDENT# emit ( ( template % { #NEWLINE# #INDENT# 'frame_identifier' : ( '%s->m_frame' % kind ) , #NEWLINE# 'frame_locals_name' : frame_locals_name , #NEWLINE# 'store_frame_locals' : indented ( locals_code , 2 , vert_block = True ) , #NEWLINE# 'tb_making' : getTracebackMakingIdentifier ( context = context , lineno_name = 'exception_lineno' ) , #NEWLINE# 'frame_exception_exit' : frame_exception_exit , #NEWLINE# 'parent_exception_exit' : parent_exception_exit , #NEWLINE# 'no_exception_exit' : no_exception_exit , #NEWLINE# #UNINDENT# } ) )