-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Python3 RuntimeError - dictionary changed size during iteration (#…
…6646) Summary: Fix Python3 RuntimeError - dictionary changed size during iteration What is the motivation for this PR? Python3 migration: In Python3, you cannot add/remove elements in a dictionary while iterating through it. How did you do it? 1. Use copy(). This way you iterate over the original dictionary fields and on the fly can change the desired dict. 2. Fix pre-commit issues. How did you verify/test it? Both Python2 and Python3 can run bgp/test_bgp_facts.py successfully.
- Loading branch information
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters