Skip to content

Commit

Permalink
fixup! testdata: Don't modify keys while iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Jan 20, 2021
1 parent 1c76ff1 commit 0112552
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test_framework/testdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,15 @@ def read(name):


# Resolve links
_data = {}
for k in data:
for k in list(data):
if '@' in k:
del data[k]
section, path = k.split('@')
section = section.strip()
path = path.strip()
fullpath = os.path.join(_test_data_dir, os.path.dirname(name), path)
with open(fullpath) as f:
_data[section] = f.read()
else:
_data[k] = data[k]
data = _data
data[section] = f.read()

# Special case: convert 'raw' section into binary
# Each line is parsed as an integer representing an instruction.
Expand Down

0 comments on commit 0112552

Please sign in to comment.