Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d59948

Browse files
committed
When piping output into a pager like "less", quiting the pager before
the output was consumed would cause and exception to be raise in logmerge; suppress this specific error, because it's not helpful.
1 parent b785518 commit 7d59948

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Tools/scripts/logmerge.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from their output.
3535
"""
3636

37-
import os, sys, getopt, re
37+
import os, sys, errno, getopt, re
3838

3939
sep1 = '='*77 + '\n' # file separator
4040
sep2 = '-'*28 + '\n' # revision separator
@@ -177,4 +177,8 @@ def format_output(database):
177177
prev.append((date, working_file, rev, author))
178178
prevtext = text
179179

180-
main()
180+
try:
181+
main()
182+
except IOError, e:
183+
if e.errno != errno.EPIPE:
184+
raise

0 commit comments

Comments
 (0)