From bd751504e1f270c150140ac32ec3a87c5b7ee4f8 Mon Sep 17 00:00:00 2001 From: Joohwan Oh Date: Thu, 24 Mar 2022 09:54:21 -0700 Subject: [PATCH] Fix broken graphviz import --- binarytree/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/binarytree/__init__.py b/binarytree/__init__.py index 56de304..4a29cc1 100644 --- a/binarytree/__init__.py +++ b/binarytree/__init__.py @@ -21,7 +21,12 @@ from typing import Any, Deque, Dict, Iterator, List, Optional, Tuple, Union from graphviz import Digraph, nohtml -from graphviz.exceptions import ExecutableNotFound + +try: + from graphviz.exceptions import ExecutableNotFound +except ImportError: + # noinspection PyProtectedMember + from graphviz import ExecutableNotFound from pkg_resources import get_distribution from binarytree.exceptions import (