handle EOFError the same way that we handle KeyboardInterrupt