diff options
Diffstat (limited to 'tempita/__init__.py')
-rw-r--r-- | tempita/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tempita/__init__.py b/tempita/__init__.py index ee8a9a4..0ddb670 100644 --- a/tempita/__init__.py +++ b/tempita/__init__.py @@ -238,7 +238,10 @@ class Template(object): except: exc_info = sys.exc_info() e = exc_info[1] - e.args = (self._add_line_info(e.args[0], pos),) + if e.args: + e.args = (self._add_line_info(e.args[0], pos),) + else: + e.args = (self._add_line_info(None, pos),) raise exc_info[0], e, exc_info[2] def _repr(self, value, pos): |