summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-11-20 20:05:52 +0100
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-12-28 14:09:03 +0100
commitf7ff2d062c4f8ae543f0cd207c51c7b9f7e2e715 (patch)
treec128d6f9181595d21477bbe7e3d60615e3c52ed8
parent459f1448604bf0cd59f2a4132aee84f9be6f9b12 (diff)
downloadpython-setuptools-git-f7ff2d062c4f8ae543f0cd207c51c7b9f7e2e715.tar.gz
Apply refurb suggestions
[FURB113]: Use `x.extend(...)` instead of repeatedly calling `x.append()`
-rw-r--r--distutils/_msvccompiler.py3
-rw-r--r--distutils/bcppcompiler.py3
-rw-r--r--distutils/tests/test_check.py11
3 files changed, 6 insertions, 11 deletions
diff --git a/distutils/_msvccompiler.py b/distutils/_msvccompiler.py
index 8b4023c4..ff2fb0cf 100644
--- a/distutils/_msvccompiler.py
+++ b/distutils/_msvccompiler.py
@@ -413,8 +413,7 @@ class MSVCCompiler(CCompiler):
args = [self.cc] + compile_opts + pp_opts
if add_cpp_opts:
args.append('/EHsc')
- args.append(input_opt)
- args.append("/Fo" + obj)
+ args.extend((input_opt, "/Fo" + obj))
args.extend(extra_postargs)
try:
diff --git a/distutils/bcppcompiler.py b/distutils/bcppcompiler.py
index 5d6b8653..c38d57c6 100644
--- a/distutils/bcppcompiler.py
+++ b/distutils/bcppcompiler.py
@@ -294,8 +294,7 @@ class BCPPCompiler(CCompiler):
ld_args.append(libfile)
# some default libraries
- ld_args.append('import32')
- ld_args.append('cw32mt')
+ ld_args.extend(('import32', 'cw32mt'))
# def file for export symbols
ld_args.extend([',', def_file])
diff --git a/distutils/tests/test_check.py b/distutils/tests/test_check.py
index 54654067..6d240b8b 100644
--- a/distutils/tests/test_check.py
+++ b/distutils/tests/test_check.py
@@ -152,8 +152,7 @@ class TestCheck(support.TempdirManager):
pytest.importorskip('docutils')
# Don't fail if there is a `code` or `code-block` directive
- example_rst_docs = []
- example_rst_docs.append(
+ example_rst_docs = [
textwrap.dedent(
"""\
Here's some code:
@@ -163,9 +162,7 @@ class TestCheck(support.TempdirManager):
def foo():
pass
"""
- )
- )
- example_rst_docs.append(
+ ),
textwrap.dedent(
"""\
Here's some code:
@@ -175,8 +172,8 @@ class TestCheck(support.TempdirManager):
def foo():
pass
"""
- )
- )
+ ),
+ ]
for rest_with_code in example_rst_docs:
pkg_info, dist = self.create_dist(long_description=rest_with_code)