Exemplo n.º 1
0
 def get_global_value(self, name):
     """
     Get a global value from the func_global (first) or
     as a builtins (second).  If both failed, return a ir.UNDEFINED.
     """
     try:
         return utils.get_function_globals(self.bytecode.func)[name]
     except KeyError:
         return getattr(builtins, name, ir.UNDEFINED)
Exemplo n.º 2
0
 def get_global_value(self, name):
     """
     Get a global value from the func_global (first) or
     as a builtins (second).  If both failed, return a ir.UNDEFINED.
     """
     try:
         return utils.get_function_globals(self.bytecode.func)[name]
     except KeyError:
         return getattr(builtins, name, ir.UNDEFINED)