util.log: fix #269

This commit is contained in:
Mort Yao 2013-11-15 16:18:51 +01:00
parent 33a39191a6
commit 3e0e9b8cc5

View File

@ -2,7 +2,7 @@
from ..version import __name__
import os, sys
import os, sys, subprocess
# Is terminal ANSI/VT100 compatible
if os.getenv('TERM') in (
@ -17,7 +17,7 @@ else:
try:
# Eshell
ppid = os.getppid()
has_colors = (os.popen('ps -p %d -ocomm=' % ppid).read().strip()
has_colors = (subprocess.getoutput('ps -p %d -ocomm=' % ppid)
== 'emacs')
except:
has_colors = False