diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-11-20 16:52:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-20 16:52:13 (GMT) |
commit | d9068338b083e61f6f1339657f5ed671712ee520 (patch) | |
tree | 406dc699d13d98626bda2f8e2dd56ebf55bd239b /SCons | |
parent | 56cd65b51a2f367ad0acce6277e88f1664a04837 (diff) | |
parent | b896b7b9649003016537a005678c576511bf3338 (diff) | |
download | SCons-d9068338b083e61f6f1339657f5ed671712ee520.zip SCons-d9068338b083e61f6f1339657f5ed671712ee520.tar.gz SCons-d9068338b083e61f6f1339657f5ed671712ee520.tar.bz2 |
Merge pull request #3827 from mwichmann/range-len
Kill a couple of "for foo in range(len(bar))"
Diffstat (limited to 'SCons')
-rw-r--r-- | SCons/Tool/tex.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/SCons/Tool/tex.py b/SCons/Tool/tex.py index 1d61e2d..0ca7e2d 100644 --- a/SCons/Tool/tex.py +++ b/SCons/Tool/tex.py @@ -429,18 +429,23 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None return result # Now decide if latex will need to be run again due to newglossary command. - for ig in range(len(newglossary_suffix)): - if check_MD5(suffix_nodes[newglossary_suffix[ig][2]],newglossary_suffix[ig][2]) or (count == 1): + for ng in newglossary_suffix: + if check_MD5(suffix_nodes[ng[2]], ng[2]) or (count == 1): # We must run makeindex if Verbose: print("Need to run makeindex for newglossary") - newglfile = suffix_nodes[newglossary_suffix[ig][2]] - MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR") + newglfile = suffix_nodes[ng[2]] + MakeNewGlossaryAction = SCons.Action.Action( + "$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" + % (ng[2], ng[0], ng[1]), + "$MAKENEWGLOSSARYCOMSTR", + ) result = MakeNewGlossaryAction(newglfile, newglfile, env) if result != 0: - check_file_error_message('%s (newglossary)' % env['MAKENEWGLOSSARY'], - newglossary_suffix[ig][0]) + check_file_error_message( + '%s (newglossary)' % env['MAKENEWGLOSSARY'], ng[0] + ) return result # Now decide if latex needs to be run yet again to resolve warnings. @@ -786,8 +791,8 @@ def tex_emitter_core(target, source, env, graphics_extensions): file_basename = os.path.join(targetdir, 'bu*.aux') file_list = glob.glob(file_basename) # remove the suffix '.aux' - for i in range(len(file_list)): - file_list.append(SCons.Util.splitext(file_list[i])[0]) + for fl in file_list.copy(): + file_list.append(SCons.Util.splitext(fl)[0]) # for multibib we need a list of files if suffix_list[-1] == 'multibib': for multibibmatch in multibib_re.finditer(content): @@ -797,8 +802,8 @@ def tex_emitter_core(target, source, env, graphics_extensions): baselist = multibibmatch.group(1).split(',') if Verbose: print("multibib list ", baselist) - for i in range(len(baselist)): - file_list.append(os.path.join(targetdir, baselist[i])) + for bl in baselist: + file_list.append(os.path.join(targetdir, bl)) # now define the side effects for file_name in file_list: for suffix in suffix_list[:-1]: |