#NEWLINE# def lower_global( self , name , value ) : #NEWLINE# #INDENT# '\n        1) Check global scope dictionary.\n        2) Check __builtins__.\n            2a) is it a dictionary (for non __main__ module)\n            2b) is it a module (for __main__ module)\n        ' #NEWLINE# moddict = self . get_module_dict ( ) #NEWLINE# obj = self . pyapi . dict_getitem ( moddict , self . _freeze_string ( name ) ) #NEWLINE# self . incref ( obj ) #NEWLINE# try : #NEWLINE# #INDENT# if ( value in _unsupported_builtins ) : #NEWLINE# #INDENT# raise ForbiddenConstruct ( ( 'builtins %s() is not supported' % name ) , loc = self . loc ) #NEWLINE# #UNINDENT# #UNINDENT# except TypeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if hasattr ( builtins , name ) : #NEWLINE# #INDENT# obj_is_null = self . is_null ( obj ) #NEWLINE# bbelse = self . builder . basic_block #NEWLINE# with self . builder . if_then ( obj_is_null ) : #NEWLINE# #INDENT# mod = self . pyapi . dict_getitem ( moddict , self . _freeze_string ( '__builtins__' ) ) #NEWLINE# builtin = self . builtin_lookup ( mod , name ) #NEWLINE# bbif = self . builder . basic_block #NEWLINE# #UNINDENT# retval = self . builder . phi ( self . pyapi . pyobj ) #NEWLINE# retval . add_incoming ( obj , bbelse ) #NEWLINE# retval . add_incoming ( builtin , bbif ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# retval = obj #NEWLINE# with cgutils . if_unlikely ( self . builder , self . is_null ( builtin ) ) : #NEWLINE# #INDENT# self . pyapi . raise_missing_global_error ( name ) #NEWLINE# self . return_exception_raised ( ) #NEWLINE# #UNINDENT# #UNINDENT# return retval