changeset 31:dd64c0e3dbe0 v0.3.1

fixed err in python 2.4 xclip detection
author catherine@localhost
date Mon, 19 May 2008 10:08:23 -0400
parents 786b3ea3e440
children 11d44bf343c7 d72627da96de
files cmd2.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmd2.py	Mon May 19 09:57:23 2008 -0400
+++ b/cmd2.py	Mon May 19 10:08:23 2008 -0400
@@ -101,8 +101,11 @@
         can_clip = True
     except AttributeError:  # check_call not defined, Python < 2.5
         teststring = 'Testing for presence of xclip.'
-        xclipproc = subprocess.check_call('xclip -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+        #import pdb; pdb.set_trace()
+        xclipproc = subprocess.Popen('xclip -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
         xclipproc.stdin.write(teststring)
+        xclipproc.stdin.close()
+        xclipproc = subprocess.Popen('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)        
         if xclipproc.stdout.read() == teststring:
             can_clip = True
     except (subprocess.CalledProcessError, OSError):