From f7ff2d062c4f8ae543f0cd207c51c7b9f7e2e715 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 20 Nov 2022 20:05:52 +0100 Subject: Apply refurb suggestions [FURB113]: Use `x.extend(...)` instead of repeatedly calling `x.append()` --- distutils/_msvccompiler.py | 3 +-- distutils/bcppcompiler.py | 3 +-- distutils/tests/test_check.py | 11 ++++------- 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) -- cgit v1.2.1