mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Python version now works as expected
This commit is contained in:
parent
e20480b9d9
commit
c1c841a11f
|
|
@ -7,10 +7,10 @@ class Segment(BasicSegment):
|
|||
powerline = self.powerline
|
||||
|
||||
try:
|
||||
p1 = subprocess.Popen(["python", "--version"], stdout=subprocess.PIPE)
|
||||
p2 = subprocess.Popen(["sed", "s/ (.*//"], stdin=p1.stdout, stdout=subprocess.PIPE)
|
||||
version = p2.communicate()[0].decode("utf-8").rstrip()
|
||||
|
||||
output = subprocess.check_output(['python', '--version'],
|
||||
stderr=subprocess.STDOUT)
|
||||
version = output.rstrip().split(' ')[1]
|
||||
powerline.append(version, 15, 1)
|
||||
except OSError:
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue