changeset 405:3bef4253cf1b

swallow echo of editor path
author Catherine Devlin <catherine.devlin@gmail.com>
date Sat, 06 Nov 2010 07:56:07 -0400
parents e60e2c15f026
children cc5c68e15a83
files cmd2.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmd2.py	Thu Sep 16 07:38:26 2010 -0400
+++ b/cmd2.py	Sat Nov 06 07:56:07 2010 -0400
@@ -423,7 +423,7 @@
             editor = 'notepad'
         else:
             for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']:
-                if not os.system('which %s' % (editor)):
+                if not subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]:
                     break
 
     colorcodes =    {'bold':{True:'\x1b[1m',False:'\x1b[22m'},