diff options
author | Ram Rachum <ram@rachum.com> | 2020-06-12 12:46:02 +0300 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2020-06-12 18:36:15 -0400 |
commit | 5891418956d08ea3ddcbf65281e6882c7e3d9662 (patch) | |
tree | dcfbddaa9cbda57ea5de68bf30e76304064c01b2 | |
parent | 142842c55b63224682d0d8442b15a1825d86d7c4 (diff) | |
download | python-markdown-5891418956d08ea3ddcbf65281e6882c7e3d9662.tar.gz |
Fix exception cause in core.py
-rw-r--r-- | markdown/core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/markdown/core.py b/markdown/core.py index e2c0d88..79ca3f3 100644 --- a/markdown/core.py +++ b/markdown/core.py @@ -276,14 +276,14 @@ class Markdown: '<%s>' % self.doc_tag) + len(self.doc_tag) + 2 end = output.rindex('</%s>' % self.doc_tag) output = output[start:end].strip() - except ValueError: # pragma: no cover + except ValueError as e: # pragma: no cover if output.strip().endswith('<%s />' % self.doc_tag): # We have an empty document output = '' else: # We have a serious problem raise ValueError('Markdown failed to strip top-level ' - 'tags. Document=%r' % output.strip()) + 'tags. Document=%r' % output.strip()) from e # Run the text post-processors for pp in self.postprocessors: |