Adding in this barf of a hack beacuse it pleases me.

This commit is contained in:
Paul R. Tagliamonte 2013-04-10 23:06:55 -04:00
parent f6b94b1b40
commit b65f78a0c7

View File

@ -959,14 +959,19 @@ def hy_compile(tree, root=None):
if entry in imported:
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)
imports.append(HyExpression([
HySymbol("import_from"),
HySymbol(package),
HySymbol(entry)
]).replace(tree[0])) # form))
# using form causes pypy to blow up; let's conditionally
# add this for cpython or something. Muhahaha. - PRT
]).replace(replace))
_ast = compiler.compile(imports) + _ast