From 6e61f04e46f2b74dcd8d88d4ed745347a1dd5fff Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Thu, 27 Nov 2014 15:29:34 -0800 Subject: [PATCH] HyMacroExpansionError shouldn't truncate message For example: ``` $ hy hy 0.10.1 using CPython(default) 2.7.8 on Darwin => (defmacro hi [] (raise (TypeError "This message will be truncated"))) => (hi) File "", line 1, column 1 (hi) ^--^ HyMacroExpansionError: `hi' message will be truncated ```` --- hy/macros.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hy/macros.py b/hy/macros.py index 57fcea6..3d238c0 100644 --- a/hy/macros.py +++ b/hy/macros.py @@ -200,8 +200,7 @@ def macroexpand_1(tree, module_name): e.expression = tree raise except Exception as e: - msg = "`" + str(tree[0]) + "' " + \ - " ".join(str(e).split()[1:]) + msg = "expanding `" + str(tree[0]) + "': " + repr(e) raise HyMacroExpansionError(tree, msg) obj.replace(tree) return obj