From ab6b1905e51965a26ac944aefd7712668d4afadb Mon Sep 17 00:00:00 2001 From: Juha Jeronen Date: Wed, 15 May 2019 15:31:35 +0300 Subject: [PATCH] Avoid crashing in error logger when the message of a macro expansion error is not a string. --- macropy/core/failure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macropy/core/failure.py b/macropy/core/failure.py index 6eeff151..28779aad 100644 --- a/macropy/core/failure.py +++ b/macropy/core/failure.py @@ -24,7 +24,7 @@ def clear_errors(tree, **kw): tb = "".join(traceback.format_tb(tree.__traceback__)) msg = str(tree) if type(tree) is not AssertionError or tree.args == (): - msg = ("".join(tree.args) + "\nCaused by Macro-Expansion Error:\n" + + msg = ("".join(str(x) for x in tree.args) + "\nCaused by Macro-Expansion Error:\n" + tb) return hq[raise_error(MacroExpansionError(msg))] else: