1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 21:29:19 +00:00

[PR #11590/ce5d5622 backport][stable-12] replace list(map(...)) with comprehension (#11591)

replace `list(map(...))` with comprehension (#11590)

* replace `list(map(...))` with comprehension

* add changelog frag

(cherry picked from commit ce5d5622b9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2026-03-14 17:14:18 +01:00 committed by GitHub
parent c853dfb1a8
commit 99ebbbdf49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 51 additions and 52 deletions

View file

@ -660,7 +660,7 @@ class DarwinTimezone(Timezone):
# Lookup the list of supported timezones via `systemsetup -listtimezones`.
# Note: Skip the first line that contains the label 'Time Zones:'
out = self.execute(self.systemsetup, "-listtimezones").splitlines()[1:]
tz_list = list(map(lambda x: x.strip(), out))
tz_list = [x.strip() for x in out]
if tz not in tz_list:
self.abort(f'given timezone "{tz}" is not available')
return tz