diff options
| author | mryouse | 2022-07-14 02:19:33 +0000 | 
|---|---|---|
| committer | mryouse | 2022-07-14 02:19:33 +0000 | 
| commit | 2154c4fd811c5669c217593250476dda860aac36 (patch) | |
| tree | 763d9fcda6a8a9ce23c45b2ffa4e28f688376b57 /neb/exceptions.py | |
| parent | 00c5c7e2c043949ee8b3d6c32b01d338102da51f (diff) | |
bugfix: let things that aren't symbols be called
Diffstat (limited to 'neb/exceptions.py')
| -rw-r--r-- | neb/exceptions.py | 5 | 
1 files changed, 4 insertions, 1 deletions
| 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) | 
