Merge pull request #1015 from kirbyfan64/pypy_lineno

Remove PyPy line number hack (closes #977)
This commit is contained in:
Matthew Egan Odendahl 2016-04-13 12:53:16 -06:00
commit eba8e0771a

View File

@ -2591,11 +2591,6 @@ def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
`last_expression` is the.
"""
if hasattr(sys, "subversion"):
implementation = sys.subversion[0].lower()
elif hasattr(sys, "implementation"):
implementation = sys.implementation.name.lower()
body = []
expr = None
@ -2615,12 +2610,6 @@ def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
ret = root(body=body)
# PyPy _really_ doesn't like the ast going backwards...
if implementation != "cpython":
for node in ast.walk(ret):
node.lineno = 1
node.col_offset = 1
if get_expr:
expr = ast.Expression(body=expr)
ret = (ret, expr)