From 81062c5e2f65841bf7d488ca1285b8c388022207 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 11 Sep 2009 15:24:43 -0500 Subject: [PATCH] compiling AST to code is new in python 2.6 --HG-- branch : trunk --- testing/code/test_source.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 1400dee71..951ed6b5d 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -192,12 +192,12 @@ class TestSourceParsingAndCompiling: assert source.getstatementrange(5) == (0, 9) def test_compile_to_ast(self): - if sys.version_info < (2, 5): - py.test.skip("requires Python 2.5") - import _ast + if sys.version_info < (2, 6): + py.test.skip("requires Python 2.6") + import ast source = Source("x = 4") - mod = source.compile(flag=_ast.PyCF_ONLY_AST) - assert isinstance(mod, _ast.Module) + mod = source.compile(flag=ast.PyCF_ONLY_AST) + assert isinstance(mod, ast.Module) compile(mod, "", "exec") def test_compile_and_getsource(self):