Skip to content

Commit

Permalink
Fix the error handling for pydot installation check. (#763)
Browse files Browse the repository at this point in the history
`pydot.InvocationException` is only in `pydot_ng` and not in the `pydot` library.

PiperOrigin-RevId: 613787427
  • Loading branch information
sampathweb authored Mar 8, 2024
1 parent 41f92bf commit 7fb2e8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tf_keras/utils/vis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def check_graphviz():
# to check the pydot/graphviz installation.
pydot.Dot.create(pydot.Dot())
return True
except (OSError, pydot.InvocationException):
except (OSError, FileNotFoundError):
return False
# pydot_ng has InvocationException but pydot doesn't
except pydot.InvocationException:
return False


Expand Down

0 comments on commit 7fb2e8b

Please sign in to comment.