From 3afb4fdabebd06462613fd80de7d9a0267d2756c Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Mon, 8 Jul 2019 15:40:45 -0400 Subject: [PATCH] Use `mkexpr` in HyASTCompiler.imports_as_stmts --- hy/compiler.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/hy/compiler.py b/hy/compiler.py index 23afbe2..bb1da22 100755 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -402,21 +402,11 @@ class HyASTCompiler(object): ret = Result() for module, names in self.imports.items(): if None in names: - e = HyExpression([ - HySymbol("import"), - HySymbol(module), - ]).replace(expr) - ret += self.compile(e) + ret += self.compile(mkexpr('import', module).replace(expr)) names = sorted(name for name in names if name) if names: - e = HyExpression([ - HySymbol("import"), - HyList([ - HySymbol(module), - HyList([HySymbol(name) for name in names]) - ]) - ]).replace(expr) - ret += self.compile(e) + ret += self.compile(mkexpr('import', + mklist(module, mklist(*names)))) self.imports = defaultdict(set) return ret.stmts