Skip to content

Commit

Permalink
#2543: Fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Nov 12, 2024
1 parent 62fb574 commit 63104a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/psyclone/psyir/nodes/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def dag(self, file_name='dag', file_format='svg'):
self.dag_gen(graph)
try:
graph.render(filename=file_name)
except graphviz.backend.execute.ExecutableNotFound as error:
except graphviz.ExecutableNotFound as error:
print(error)
# TODO #11 add a warning to a log file here
# silently return if graphviz bindings are not installed
Expand Down
7 changes: 4 additions & 3 deletions src/psyclone/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ def have_graphviz():
''' Whether or not the system has graphviz installed. Note that this
only checks for the Python bindings. The underlying library must
also have been installed for dag generation to work correctly. '''
# pylint: disable=import-outside-toplevel
import graphviz
try:
# pylint: disable=import-outside-toplevel, unused-import
import graphviz # noqa: F401
except ImportError:
graphviz.version()
except graphviz.ExecutableNotFound:
return False
return True

Expand Down
2 changes: 1 addition & 1 deletion src/psyclone/tests/psyir/nodes/node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def test_node_dag_no_graphviz(tmpdir, monkeypatch):
when graphviz is not installed. We make this test independent of whether or
not graphviz is installed by monkeypatching sys.modules. '''
def not_installed(_, **kwargs):
raise graphviz.backend.execute.ExecutableNotFound("error")
raise graphviz.ExecutableNotFound("error")
monkeypatch.setattr(graphviz.graphs.Digraph, "render", not_installed)
monkeypatch.setitem(sys.modules, 'graphviz', None)
_, invoke_info = parse(
Expand Down

0 comments on commit 63104a2

Please sign in to comment.