Skip to content

Commit

Permalink
Fix redefinition of 'parent' variable by deleting it from function args
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Oct 11, 2023
1 parent 2f58c5a commit 3c535b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ciscoconfparse/ciscoconfparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5156,13 +5156,13 @@ def _macro_mark_children(self, macro_parent_idx_list):
# This method is on ConfigList()
@logger.catch(reraise=True)
def _maintain_bootstrap_parent_cache(
self, parents_cache, parent, indent, max_indent, is_config_line
self, parents_cache, indent, max_indent, is_config_line
):
## Parent cache:
## Maintain indent vs max_indent in a family and
## cache the parent until indent<max_indent
parent = None
if (indent < max_indent) and is_config_line:
parent = None
# walk parents and intelligently prune stale parents
stale_parent_idxs = filter(
lambda ii: ii >= indent,
Expand Down Expand Up @@ -5266,7 +5266,7 @@ def _bootstrap_obj_init_ng(self, text_list=None, debug=0):
macro_parent_idx_list.append(obj.linenum)

parents_cache, parent = self._maintain_bootstrap_parent_cache(
parents_cache, parent, indent, max_indent, is_config_line
parents_cache, indent, max_indent, is_config_line
)

## If indented, walk backwards and find the parent...
Expand Down

0 comments on commit 3c535b4

Please sign in to comment.