Handle broken pipe exceptions more effectively

This commit is contained in:
Matt Martz 2016-03-07 17:00:46 -06:00
parent 9913b9915f
commit 1c0a029ca6
1 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import re
import csv import csv
import sys import sys
import math import math
import errno
import signal import signal
import socket import socket
import timeit import timeit
@ -1240,8 +1241,10 @@ def shell():
try: try:
print_(line) print_(line)
server_list.append(line) server_list.append(line)
except BROKEN_PIPE_ERROR: except IOError:
pass e = sys.exc_info()[1]
if e.errno != errno.EPIPE:
raise
sys.exit(0) sys.exit(0)
# Set a filter of servers to retrieve # Set a filter of servers to retrieve