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 "<input>", line 1, column 1

  (hi)
  ^--^
HyMacroExpansionError: `hi' message will be truncated
````
This commit is contained in:
Michael Maltese 2014-11-27 15:29:34 -08:00
parent 2fd9c91cd3
commit 6e61f04e46
1 changed files with 1 additions and 2 deletions

View File

@ -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