Skip to content

Commit

Permalink
Account for deprecation of DiGraph._repr_svg_ in graphviz
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 authored and joowani committed Jun 28, 2022
1 parent 397e65f commit 87ff18a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions binarytree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,12 @@ def _repr_svg_(self) -> str: # pragma: no cover
.. _Jupyter notebooks: https://jupyter.org
"""
try:
# noinspection PyProtectedMember
return str(self.graphviz()._repr_svg_())
try:
# noinspection PyProtectedMember
return str(self.graphviz()._repr_svg_())
except AttributeError:
# noinspection PyProtectedMember
return self.graphviz()._repr_image_svg_xml()

except (SubprocessError, ExecutableNotFound, FileNotFoundError):
return self.svg()
Expand Down

0 comments on commit 87ff18a

Please sign in to comment.