# HG changeset patch # User catherine@dellzilla # Date 1227031963 18000 # Node ID f0fa9965a985d3d69561ad1705c2b77ae21d05e3 # Parent c05afe3b550101af3d156c072f2f825c3b9b6b21 catch xclip-absent input errors diff -r c05afe3b5501 -r f0fa9965a985 cmd2.py --- a/cmd2.py Mon Nov 17 14:32:18 2008 -0500 +++ b/cmd2.py Tue Nov 18 13:12:43 2008 -0500 @@ -313,14 +313,14 @@ statekeeper = None stop = 0 if statement.input: - if statement.inputFrom: - try: + try: + if statement.inputFrom: newinput = open(statement.inputFrom, 'r').read() - except OSError, e: - print e - return 0 - else: - newinput = getPasteBuffer() + else: + newinput = getPasteBuffer() + except (OSError,), e: + print e + return 0 start, end = self.redirectInPattern.scanString(statement.fullStatement).next()[1:] return self.onecmd('%s%s%s' % (statement.fullStatement[:start], newinput, statement.fullStatement[end:]))