core[patch]: Remove print statement on missing grandalf dependency in favor of more explicit ImportError (#16326)

After this PR an ImportError will be raised without a print if grandalf
is missing when using grandalf related code for printing runnable
graphs.
This commit is contained in:
James Braza 2024-01-22 07:48:54 -08:00 committed by GitHub
parent 971a68d04f
commit e1c59779ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -165,9 +165,11 @@ def _build_sugiyama_layout(
EdgeViewer, EdgeViewer,
route_with_lines, route_with_lines,
) )
except ImportError: except ImportError as exc:
print("Install grandalf to draw graphs. `pip install grandalf`") raise ImportError(
raise "Install grandalf to draw graphs: `pip install grandalf`."
) from exc
# #
# Just a reminder about naming conventions: # Just a reminder about naming conventions:
# +------------X # +------------X