From eee65f3051ee789fd8e67a3c0ee29dc3214e3200 Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Wed, 10 Apr 2013 23:11:54 -0400 Subject: [PATCH] Update to the style. --- hy/compiler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hy/compiler.py b/hy/compiler.py index a8075e2..d1d4772 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -951,6 +951,11 @@ def hy_compile(tree, root=None): if type(_ast) == list: _ast = compiler._mangle_branch(_ast, 0, 0) + if hasattr(sys, "subversion"): + implementation = sys.subversion[0].lower() + elif hasattr(sys, "implementation"): + implementation = sys.implementation.name.lower() + imports = [] for package in compiler.imports: imported = set() @@ -960,7 +965,7 @@ def hy_compile(tree, root=None): continue replace = form - if hasattr(sys, "subversion") and sys.subversion[0] == "PyPy": + if implementation != "cpython": # 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