Skip to content

Commit

Permalink
Fix an issue when printing the graph overwriting (#3814)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Nov 7, 2024
1 parent 3c42504 commit 76c134c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cfnlint/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import json
import logging
import warnings
from copy import deepcopy
from typing import Any

import networkx
Expand Down Expand Up @@ -308,7 +309,8 @@ def _find_parameter(self, string):
# pylint: disable=import-outside-toplevel,unused-variable
def to_dot(self, path):
"""Export the graph to a file with DOT format"""
view = self.settings.subgraph_view(self.graph)
graph = deepcopy(self.graph)
view = self.settings.subgraph_view(graph)
try:
networkx.drawing.nx_agraph.write_dot(view, path)
except ImportError:
Expand Down

0 comments on commit 76c134c

Please sign in to comment.