Skip to content

Commit

Permalink
oops, move back to _ast since I want to compare with Python 2.5 which…
Browse files Browse the repository at this point in the history
… does not

yet have ast.py.
  • Loading branch information
fwierzbicki committed Jan 14, 2009
1 parent 21022d9 commit 59862a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ast/astview.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

import ast
import _ast
import sys

if sys.platform.startswith('java'):
Expand Down Expand Up @@ -49,7 +49,7 @@ def lispify_field(field, child):
children = [child]

for node in children:
if isinstance(node, ast.AST):
if isinstance(node, _ast.AST):
yield lispify_ast(node)
else:
if isinstance(node, float):
Expand All @@ -64,7 +64,7 @@ def lispify_field(field, child):

def tree(pyfile):
try:
node = compile(open(pyfile).read(), pyfile, "exec", ast.PyCF_ONLY_AST)
node = compile(open(pyfile).read(), pyfile, "exec", _ast.PyCF_ONLY_AST)
except SyntaxError:
return "SyntaxError",
return lispify_ast(node)
Expand Down

0 comments on commit 59862a4

Please sign in to comment.