Skip to content

Commit b299d41

Browse files
committed
Fixed #61
The input_list in the pre_generate method needs to be copied and be used. Otherwise, the value in the input_list may be changed based on the action number.
1 parent 848a058 commit b299d41

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

about_code_tool/genabout.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from os.path import exists, dirname, join, abspath, isdir
2727
import about
2828
import csv
29+
import copy
2930
import errno
3031
import json
3132
import getopt
@@ -267,7 +268,11 @@ def pre_generation(self, gen_location, input_list, action_num, all_in_one):
267268
according to the action_num.
268269
"""
269270
output_list = []
270-
for component in input_list:
271+
# The input_list needs to be copied and be used below.
272+
# Otherwise, the value in the input_list may be changed based on the
273+
# action number below
274+
copied_list = copy.deepcopy(input_list)
275+
for component in copied_list:
271276
for line in component:
272277
component_list = []
273278
file_location = line['about_file']

0 commit comments

Comments
 (0)