From 73721fe8ea38a8d3f852b2c41abea86620e9693c Mon Sep 17 00:00:00 2001 From: Daniel Alonso Date: Sat, 20 Feb 2021 20:52:44 +0100 Subject: [PATCH] 'Map' object is not accountable It's needed to perform a 'list' transformation before doing a count of the 'map' object. --- powerline_shell/segments/jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerline_shell/segments/jobs.py b/powerline_shell/segments/jobs.py index e5d0551..8d3a21f 100644 --- a/powerline_shell/segments/jobs.py +++ b/powerline_shell/segments/jobs.py @@ -11,8 +11,8 @@ class Segment(ThreadedSegment): if platform.system().startswith('CYGWIN'): # cygwin ps is a special snowflake... output_proc = subprocess.Popen(['ps', '-af'], stdout=subprocess.PIPE) - output = map(lambda l: int(l.split()[2].strip()), - output_proc.communicate()[0].decode("utf-8").splitlines()[1:]) + output = list(map(lambda l: int(l.split()[2].strip()), + output_proc.communicate()[0].decode("utf-8").splitlines()[1:])) self.num_jobs = output.count(os.getppid()) - 1 else: pppid_proc = subprocess.Popen(['ps', '-p', str(os.getppid()), '-oppid='],