summaryrefslogtreecommitdiff
path: root/tempita/__init__.py
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 /tempita/__init__.py
parent5041a23297c20a522c2ed7aa8f2e26514f3d49f3 (diff)
downloadtempita-457b208cdffd91e851629357dd42ca8cad091711.tar.gz
Make the error messages somewhat more robust when e.args is empty
Diffstat (limited to 'tempita/__init__.py')
-rw-r--r--tempita/__init__.py5
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):