Merge pull request #1015 from kirbyfan64/pypy_lineno
Remove PyPy line number hack (closes #977)
This commit is contained in:
commit
eba8e0771a
@ -2591,11 +2591,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
|
||||||
|
|
||||||
@ -2615,12 +2610,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