diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-07-19 16:21:06 -0700 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-07-19 16:21:06 -0700 |
commit | c030dd99367d2eebd221d65fa3970400ed93a328 (patch) | |
tree | 61334249bdd222ec354c2c3728135fbb381dd30d | |
parent | 5fe63dce7c7a77079e8e5ebd49c2d8dc79e2d77d (diff) | |
parent | c4384043a84b6b495f73f4fb6afc3e2d2d985894 (diff) | |
download | markdown-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.py | 5 |
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. """ |