#165 fix python 2 support

This commit is contained in:
nvbn
2015-05-06 13:17:14 +02:00
parent 608d48e408
commit 5864faadef
3 changed files with 9 additions and 7 deletions
+3 -5
View File
@@ -8,9 +8,7 @@ from subprocess import Popen, PIPE
from time import time
import os
from psutil import Process
FNULL = open(os.devnull, 'w')
from .utils import DEVNULL
class Generic(object):
@@ -58,7 +56,7 @@ class Bash(Generic):
return name, value
def _get_aliases(self):
proc = Popen('bash -ic alias', stdout=PIPE, stderr=FNULL, shell=True)
proc = Popen('bash -ic alias', stdout=PIPE, stderr=DEVNULL, shell=True)
return dict(
self._parse_alias(alias)
for alias in proc.stdout.read().decode('utf-8').split('\n')
@@ -80,7 +78,7 @@ class Zsh(Generic):
return name, value
def _get_aliases(self):
proc = Popen('zsh -ic alias', stdout=PIPE, stderr=FNULL, shell=True)
proc = Popen('zsh -ic alias', stdout=PIPE, stderr=DEVNULL, shell=True)
return dict(
self._parse_alias(alias)
for alias in proc.stdout.read().decode('utf-8').split('\n')