mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
util.log: fix #269
This commit is contained in:
parent
33a39191a6
commit
3e0e9b8cc5
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from ..version import __name__
|
from ..version import __name__
|
||||||
|
|
||||||
import os, sys
|
import os, sys, subprocess
|
||||||
|
|
||||||
# Is terminal ANSI/VT100 compatible
|
# Is terminal ANSI/VT100 compatible
|
||||||
if os.getenv('TERM') in (
|
if os.getenv('TERM') in (
|
||||||
@ -17,7 +17,7 @@ else:
|
|||||||
try:
|
try:
|
||||||
# Eshell
|
# Eshell
|
||||||
ppid = os.getppid()
|
ppid = os.getppid()
|
||||||
has_colors = (os.popen('ps -p %d -ocomm=' % ppid).read().strip()
|
has_colors = (subprocess.getoutput('ps -p %d -ocomm=' % ppid)
|
||||||
== 'emacs')
|
== 'emacs')
|
||||||
except:
|
except:
|
||||||
has_colors = False
|
has_colors = False
|
||||||
|
Loading…
Reference in New Issue
Block a user