예제 #1
0
def main():
    try:
        run(sys.argv, sys.stdin, sys.stdout)
    except EnvironmentError as e:
        # Workaround for close failed in file object destructor: sys.excepthook is missing lost sys.stderr
        # http://stackoverflow.com/questions/7955138/addressing-sys-excepthook-error-in-bash-script
        print >> sys.stderr, str(e)
        sys.exit(1)
    except KeyboardInterrupt:
        sys.exit(1)
예제 #2
0
def main():
    try:
        run(sys.argv, sys.stdin, sys.stdout)
    except EnvironmentError as e:
        # Workaround for close failed in file object destructor: sys.excepthook is missing lost sys.stderr
        # http://stackoverflow.com/questions/7955138/addressing-sys-excepthook-error-in-bash-script
        print >> sys.stderr, str(e)
        sys.exit(1)
    except KeyboardInterrupt:
        sys.exit(1)
예제 #3
0
파일: pawk_test.py 프로젝트: chirayuk/pawk
def run_integration_test(input, args):
    input = StringIO(input.strip())
    output = StringIO()
    run(['pawk'] + args, input, output)
    return output.getvalue().strip()
예제 #4
0
def run_integration_test(input, args):
    input = StringIO(input.strip())
    output = StringIO()
    run(['pawk'] + args, input, output)
    return output.getvalue().strip()