From 2154c4fd811c5669c217593250476dda860aac36 Mon Sep 17 00:00:00 2001 From: mryouse Date: Thu, 14 Jul 2022 02:19:33 +0000 Subject: bugfix: let things that aren't symbols be called --- neb/exceptions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'neb/exceptions.py') diff --git a/neb/exceptions.py b/neb/exceptions.py index cc0f915..c34097a 100644 --- a/neb/exceptions.py +++ b/neb/exceptions.py @@ -3,7 +3,10 @@ class NebPanic(BaseException): class InterpretPanic(NebPanic): def __init__(self, sym, msg, arg=None): - big_message = f"[{sym.line}] '{sym.name}': {msg}" + if hasattr(sym, "line"): + big_message = f"[{sym.line}] '{sym.name}': {msg}" + else: + big_message = f"[??] '{sym.name}': {msg}" if arg is not None: big_message += f" (got {arg})" super().__init__(big_message) -- cgit v1.2.3