summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/index.txt5
-rw-r--r--tempita/__init__.py5
2 files changed, 9 insertions, 1 deletions
diff --git a/docs/index.txt b/docs/index.txt
index 7ef2598..ef2da2f 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -421,6 +421,11 @@ Still To Do
News
====
+svn trunk
+---------
+
+* Make error message annotation slightly more robust
+
0.2
---
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):