Skip to content

Commit f091bdc

Browse files
committed
Switch CYGWIN job counting code from map to list comprehension
Closes #516
1 parent 0c9ccee commit f091bdc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

powerline_shell/segments/jobs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def run(self):
1313
if system.startswith("CYGWIN") or system.startswith("MINGW"):
1414
# cygwin ps is a special snowflake...
1515
output_proc = subprocess.Popen(["ps", "-af"], stdout=subprocess.PIPE)
16-
output = map(lambda l: int(l.split()[2].strip()),
17-
output_proc.communicate()[0].decode("utf-8").splitlines()[1:])
16+
output = [int(l.split()[2].strip()) for l in output_proc.communicate()[0].decode("utf-8").splitlines()[1:]]
1817
self.num_jobs = output.count(os.getppid()) - 1
1918
else:
2019
# The following logic was tested on:

0 commit comments

Comments
 (0)