Skip to content

Commit 678e38a

Browse files
authored
Merge pull request #245 from DimitriPapadopoulos/FURB
Apply ruff/refurb rules (FURB)
2 parents 5598256 + 8b9f35e commit 678e38a

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

distutils/dir_util.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def create_tree(base_dir, files, mode=0o777, verbose=1, dry_run=0):
9494
'dry_run' flags are as for 'mkpath()'.
9595
"""
9696
# First get the list of directories to create
97-
need_dir = set()
98-
for file in files:
99-
need_dir.add(os.path.join(base_dir, os.path.dirname(file)))
97+
need_dir = set(os.path.join(base_dir, os.path.dirname(file)) for file in files)
10098

10199
# Now create them
102100
for dir in sorted(need_dir):

distutils/dist.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,15 @@ def _show_help(
647647
options = self.global_options
648648
parser.set_option_table(options)
649649
parser.print_help(self.common_usage + "\nGlobal options:")
650-
print('')
650+
print()
651651

652652
if display_options:
653653
parser.set_option_table(self.display_options)
654654
parser.print_help(
655655
"Information display options (just display "
656656
+ "information, ignore any commands)"
657657
)
658-
print('')
658+
print()
659659

660660
for command in self.commands:
661661
if isinstance(command, type) and issubclass(command, Command):
@@ -669,7 +669,7 @@ def _show_help(
669669
else:
670670
parser.set_option_table(klass.user_options)
671671
parser.print_help("Options for '%s' command:" % klass.__name__)
672-
print('')
672+
print()
673673

674674
print(gen_usage(self.script_name))
675675

@@ -686,7 +686,7 @@ def handle_display_options(self, option_order):
686686
# we ignore "foo bar").
687687
if self.help_commands:
688688
self.print_commands()
689-
print('')
689+
print()
690690
print(gen_usage(self.script_name))
691691
return 1
692692

distutils/tests/test_msvc9compiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_remove_visual_c_ref(self):
161161
f = open(manifest)
162162
try:
163163
# removing trailing spaces
164-
content = '\n'.join([line.rstrip() for line in f.readlines()])
164+
content = '\n'.join([line.rstrip() for line in f])
165165
finally:
166166
f.close()
167167

distutils/unixccompiler.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,7 @@ def find_library_file(self, dirs, lib, debug=0):
389389

390390
roots = map(self._library_root, dirs)
391391

392-
searched = (
393-
os.path.join(root, lib_name)
394-
for root, lib_name in itertools.product(roots, lib_names)
395-
)
392+
searched = itertools.starmap(os.path.join, itertools.product(roots, lib_names))
396393

397394
found = filter(os.path.exists, searched)
398395

0 commit comments

Comments
 (0)