comparison cmd2.py @ 130:64ad2b28d69d

avoid crash when xclip missing
author catherine@dellzilla
date Fri, 07 Nov 2008 14:49:32 -0500
parents 8def9dec155f
children d94b79807da0
comparison
equal deleted inserted replaced
129:1fc93cef06d5 130:64ad2b28d69d
340 self.history.append(statement.fullStatement) 340 self.history.append(statement.fullStatement)
341 finally: 341 finally:
342 if statekeeper: 342 if statekeeper:
343 if statement.output and not statement.outputTo: 343 if statement.output and not statement.outputTo:
344 self.stdout.seek(0) 344 self.stdout.seek(0)
345 writeToPasteBuffer(self.stdout.read()) 345 try:
346 writeToPasteBuffer(self.stdout.read())
347 except Exception, e:
348 print str(e)
346 elif statement.pipe: 349 elif statement.pipe:
347 for result in redirect.communicate(): 350 for result in redirect.communicate():
348 statekeeper.stdout.write(result or '') 351 statekeeper.stdout.write(result or '')
349 self.stdout.close() 352 self.stdout.close()
350 statekeeper.restore() 353 statekeeper.restore()