|
for i, (ID, file) in enumerate(zip(IDs, file_list)): |
|
if args.ID_list is not None: |
|
if not ID in args.ID_list: |
|
IDs.remove(ID) |
|
file_list.remove(file) |
|
continue |
|
if regex is not None: |
|
_ID = regex.sub("", ID) |
|
IDs[i] = _ID |
The IDs and file_list variables are being dynamically changed while also iterating over them which doesn't lead to the desired effect
Suggested fix:
import copy
Then at the lines above
IDs_copy = copy.deepcopy(IDs)
file_list_copy = copy.deepcopy(file_list)
for i, (ID, file) in enumerate(zip(IDs_copy, file_list_copy))
PyP-BEAGLE/PyP-BEAGLE/command_line.py
Lines 145 to 153 in 037d1f4
The IDs and file_list variables are being dynamically changed while also iterating over them which doesn't lead to the desired effect
Suggested fix:
import copyThen at the lines above