diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-03-19 10:18:21 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-03-19 10:18:21 -0400 |
commit | 4dd11abae221fdd76d863487fac16ee45b05c96b (patch) | |
tree | 9571e6cd49f689492b500a34360ba02ec707ad75 /markdown/odict.py | |
parent | f842c9aaabd1815a5a045b0575ef73e7d02c3136 (diff) | |
download | markdown-4dd11abae221fdd76d863487fac16ee45b05c96b.tar.gz markdown-4dd11abae221fdd76d863487fac16ee45b05c96b.tar.bz2 markdown-4dd11abae221fdd76d863487fac16ee45b05c96b.zip |
Fixed #85. Odict now handles link errors correctly.
Also added a test. Thanks for the report.
Diffstat (limited to 'markdown/odict.py')
-rw-r--r-- | markdown/odict.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown/odict.py b/markdown/odict.py index bf3ef07..36d5553 100644 --- a/markdown/odict.py +++ b/markdown/odict.py @@ -150,13 +150,13 @@ class OrderedDict(dict): """ Change location of an existing item. """ n = self.keyOrder.index(key) del self.keyOrder[n] - i = self.index_for_location(location) try: + i = self.index_for_location(location) if i is not None: self.keyOrder.insert(i, key) else: self.keyOrder.append(key) - except Error: + except Exception as e: # restore to prevent data loss and reraise self.keyOrder.insert(n, key) - raise Error + raise e |