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,
route_with_lines,
)
except ImportError:
print("Install grandalf to draw graphs. `pip install grandalf`")
raise
except ImportError as exc:
raise ImportError(
"Install grandalf to draw graphs: `pip install grandalf`."
) from exc
#
# Just a reminder about naming conventions:
# +------------X