Skip to content

Commit 5891418

Browse files
cool-RRwaylan
authored andcommitted
Fix exception cause in core.py
1 parent 142842c commit 5891418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

markdown/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,14 @@ def convert(self, source):
276276
'<%s>' % self.doc_tag) + len(self.doc_tag) + 2
277277
end = output.rindex('</%s>' % self.doc_tag)
278278
output = output[start:end].strip()
279-
except ValueError: # pragma: no cover
279+
except ValueError as e: # pragma: no cover
280280
if output.strip().endswith('<%s />' % self.doc_tag):
281281
# We have an empty document
282282
output = ''
283283
else:
284284
# We have a serious problem
285285
raise ValueError('Markdown failed to strip top-level '
286-
'tags. Document=%r' % output.strip())
286+
'tags. Document=%r' % output.strip()) from e
287287

288288
# Run the text post-processors
289289
for pp in self.postprocessors:

0 commit comments

Comments
 (0)