Skip to content

Commit c192c09

Browse files
MAINT: Apply ruff/flake8-bugbear rule B007
B007 Loop control variable not used within loop body
1 parent eb6ac83 commit c192c09

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/neps/tools/build_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def nep_metadata():
3838

3939
# The title should be the first line after a line containing only
4040
# * or = signs.
41-
for i, line in enumerate(lines[:-1]):
41+
for line in lines[:-1]:
4242
chars = set(line.rstrip())
4343
if len(chars) == 1 and ("=" in chars or "*" in chars):
4444
break

numpy/random/tests/test_extending.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_cython(tmp_path):
8383
g = glob.glob(str(target_dir / "*" / "extending.pyx.c"))
8484
with open(g[0]) as fid:
8585
txt_to_find = 'NumPy API declarations from "numpy/__init__'
86-
for i, line in enumerate(fid):
86+
for line in fid:
8787
if txt_to_find in line:
8888
break
8989
else:

tools/c_coverage/c_coverage_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def collect_stats(files, fd, pattern):
122122

123123
current_file = None
124124
current_function = None
125-
for i, line in enumerate(fd):
125+
for line in fd:
126126
if re.match("f[lie]=.+", line):
127127
path = line.split('=', 2)[1].strip()
128128
if os.path.exists(path) and re.search(pattern, path):

0 commit comments

Comments
 (0)