def visit_Assert(self, node): args = [ _build(ast.Str, s=to_source(node.test)), node.msg if node.msg is not None else _build(ast.Str, s=''), _build(ast.Call, func=_build(ast.Name, id='globals', ctx=ast.Load()), args=[], keywords=[], starargs=None, kwargs=None), _build(ast.Call, func=_build(ast.Name, id='locals', ctx=ast.Load()), args=[], keywords=[], starargs=None, kwargs=None) ] return ast.copy_location( _build(ast.Expr, value=_build(ast.Call, func=_build(ast.Name, id='assert_hook', ctx=ast.Load()), args=args, keywords=[], starargs=None, kwargs=None)), node)
def visit_Assert(self, node): args = [_build(ast.Str, s=to_source(node.test)), node.msg if node.msg is not None else _build(ast.Str, s=''), _build(ast.Call, func=_build(ast.Name, id='globals', ctx=ast.Load()), args=[], keywords=[], starargs=None, kwargs=None), _build(ast.Call, func=_build(ast.Name, id='locals', ctx=ast.Load()), args=[], keywords=[], starargs=None, kwargs=None) ] return ast.copy_location( _build(ast.Expr, value=_build(ast.Call, func=_build(ast.Name, id='assert_hook', ctx=ast.Load()), args=args, keywords=[], starargs=None, kwargs=None)), node)
def eval(self, node): return eval(to_source(node), self.globals, self.locals)
def code(self): """The :attr:`node` compiled into a code object.""" if COMPILES_AST: return compile(self.node, self.filename, 'exec') return compile(to_source(self.node), self.filename, 'exec')