summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-11-17 17:28:31 +0000
committerianb <devnull@localhost>2008-11-17 17:28:31 +0000
commit457b208cdffd91e851629357dd42ca8cad091711 (patch)
tree094ac449b9d768132741dc35fcd6924e3a55d9a9
parent5041a23297c20a522c2ed7aa8f2e26514f3d49f3 (diff)
downloadtempita-457b208cdffd91e851629357dd42ca8cad091711.tar.gz
Make the error messages somewhat more robust when e.args is empty
-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):