# HG changeset patch # User catherine@localhost # Date 1211206103 14400 # Node ID dd64c0e3dbe0b923081543946f0e1a64b57e5f61 # Parent 786b3ea3e4405f7817337ac81d736487ff99b840 fixed err in python 2.4 xclip detection diff -r 786b3ea3e440 -r dd64c0e3dbe0 cmd2.py --- 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):