aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-07-19 16:21:06 -0700
committerWaylan Limberg <waylan@gmail.com>2012-07-19 16:21:06 -0700
commitc030dd99367d2eebd221d65fa3970400ed93a328 (patch)
tree61334249bdd222ec354c2c3728135fbb381dd30d
parent5fe63dce7c7a77079e8e5ebd49c2d8dc79e2d77d (diff)
parentc4384043a84b6b495f73f4fb6afc3e2d2d985894 (diff)
downloadmarkdown-c030dd99367d2eebd221d65fa3970400ed93a328.tar.gz
markdown-c030dd99367d2eebd221d65fa3970400ed93a328.tar.bz2
markdown-c030dd99367d2eebd221d65fa3970400ed93a328.zip
Merge pull request #122 from Scorpil/master
More expressive ValueError description
-rw-r--r--markdown/odict.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/markdown/odict.py b/markdown/odict.py
index d545a46..d77d701 100644
--- a/markdown/odict.py
+++ b/markdown/odict.py
@@ -117,7 +117,10 @@ class OrderedDict(dict):
def index(self, key):
""" Return the index of a given key. """
- return self.keyOrder.index(key)
+ try:
+ return self.keyOrder.index(key)
+ except ValueError, e:
+ raise ValueError("Element '%s' was not found in OrderedDict" % key)
def index_for_location(self, location):
""" Return index or None for a given location. """