Remove PyPy line number hack (closes #977)
This commit is contained in:
parent
f9cf39ee73
commit
6e66edd7a0
@ -2583,11 +2583,6 @@ def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
|
|||||||
`last_expression` is the.
|
`last_expression` is the.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if hasattr(sys, "subversion"):
|
|
||||||
implementation = sys.subversion[0].lower()
|
|
||||||
elif hasattr(sys, "implementation"):
|
|
||||||
implementation = sys.implementation.name.lower()
|
|
||||||
|
|
||||||
body = []
|
body = []
|
||||||
expr = None
|
expr = None
|
||||||
|
|
||||||
@ -2607,12 +2602,6 @@ def hy_compile(tree, module_name, root=ast.Module, get_expr=False):
|
|||||||
|
|
||||||
ret = root(body=body)
|
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:
|
if get_expr:
|
||||||
expr = ast.Expression(body=expr)
|
expr = ast.Expression(body=expr)
|
||||||
ret = (ret, expr)
|
ret = (ret, expr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user