mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
'Map' object is not accountable
It's needed to perform a 'list' transformation before doing a count of the 'map' object.
This commit is contained in:
parent
a9b8c9bb39
commit
73721fe8ea
|
|
@ -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='],
|
||||
|
|
|
|||
Loading…
Reference in a new issue