Skip to content

Commit 7fb2e8b

Browse files
authored
Fix the error handling for pydot installation check. (#763)
`pydot.InvocationException` is only in `pydot_ng` and not in the `pydot` library. PiperOrigin-RevId: 613787427
1 parent 41f92bf commit 7fb2e8b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: tf_keras/utils/vis_utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def check_graphviz():
5656
# to check the pydot/graphviz installation.
5757
pydot.Dot.create(pydot.Dot())
5858
return True
59-
except (OSError, pydot.InvocationException):
59+
except (OSError, FileNotFoundError):
60+
return False
61+
# pydot_ng has InvocationException but pydot doesn't
62+
except pydot.InvocationException:
6063
return False
6164

6265

0 commit comments

Comments
 (0)