Skip to content

Commit f7ff2d0

Browse files
Apply refurb suggestions
[FURB113]: Use `x.extend(...)` instead of repeatedly calling `x.append()`
1 parent 459f144 commit f7ff2d0

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

distutils/_msvccompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,7 @@ def compile( # noqa: C901
413413
args = [self.cc] + compile_opts + pp_opts
414414
if add_cpp_opts:
415415
args.append('/EHsc')
416-
args.append(input_opt)
417-
args.append("/Fo" + obj)
416+
args.extend((input_opt, "/Fo" + obj))
418417
args.extend(extra_postargs)
419418

420419
try:

distutils/bcppcompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ def link( # noqa: C901
294294
ld_args.append(libfile)
295295

296296
# some default libraries
297-
ld_args.append('import32')
298-
ld_args.append('cw32mt')
297+
ld_args.extend(('import32', 'cw32mt'))
299298

300299
# def file for export symbols
301300
ld_args.extend([',', def_file])

distutils/tests/test_check.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ def test_check_restructuredtext_with_syntax_highlight(self):
152152
pytest.importorskip('docutils')
153153
# Don't fail if there is a `code` or `code-block` directive
154154

155-
example_rst_docs = []
156-
example_rst_docs.append(
155+
example_rst_docs = [
157156
textwrap.dedent(
158157
"""\
159158
Here's some code:
@@ -163,9 +162,7 @@ def test_check_restructuredtext_with_syntax_highlight(self):
163162
def foo():
164163
pass
165164
"""
166-
)
167-
)
168-
example_rst_docs.append(
165+
),
169166
textwrap.dedent(
170167
"""\
171168
Here's some code:
@@ -175,8 +172,8 @@ def foo():
175172
def foo():
176173
pass
177174
"""
178-
)
179-
)
175+
),
176+
]
180177

181178
for rest_with_code in example_rst_docs:
182179
pkg_info, dist = self.create_dist(long_description=rest_with_code)

0 commit comments

Comments
 (0)