Adding in this barf of a hack beacuse it pleases me.
This commit is contained in:
parent
f6b94b1b40
commit
b65f78a0c7
@ -959,14 +959,19 @@ def hy_compile(tree, root=None):
|
|||||||
if entry in imported:
|
if entry in imported:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
replace = form
|
||||||
|
if hasattr(sys, "subversion") and sys.subversion[0] == "PyPy":
|
||||||
|
# using form causes pypy to blow up; let's conditionally
|
||||||
|
# add this for cpython, since it won't go through and make
|
||||||
|
# sure the AST makes sense. Muhahaha. - PRT
|
||||||
|
replace = tree[0]
|
||||||
|
|
||||||
imported.add(entry)
|
imported.add(entry)
|
||||||
imports.append(HyExpression([
|
imports.append(HyExpression([
|
||||||
HySymbol("import_from"),
|
HySymbol("import_from"),
|
||||||
HySymbol(package),
|
HySymbol(package),
|
||||||
HySymbol(entry)
|
HySymbol(entry)
|
||||||
]).replace(tree[0])) # form))
|
]).replace(replace))
|
||||||
# using form causes pypy to blow up; let's conditionally
|
|
||||||
# add this for cpython or something. Muhahaha. - PRT
|
|
||||||
|
|
||||||
_ast = compiler.compile(imports) + _ast
|
_ast = compiler.compile(imports) + _ast
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user