mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-23 05:26:16 +01:00
Don't crash on broken pipe (fixes bnc#661963).
This commit is contained in:
parent
b66ab73475
commit
1491dd4f4b
@ -5736,11 +5736,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
run_pager(''.join(f.readlines()))
|
run_pager(''.join(f.readlines()))
|
||||||
else:
|
else:
|
||||||
for data in streamfile(u):
|
try:
|
||||||
sys.stdout.write(data)
|
for data in streamfile(u):
|
||||||
|
sys.stdout.write(data)
|
||||||
|
except IOError, e:
|
||||||
|
pass # Ignore broken pipe, i.e. when used like 'osc cat foo | head'
|
||||||
else:
|
else:
|
||||||
e.osc_msg = 'If linked, try: cat -e'
|
e.osc_msg = 'If linked, try: cat -e'
|
||||||
raise e
|
raise e
|
||||||
|
except IOError, e:
|
||||||
|
pass # Ignore broken pipe, i.e. when used like 'osc cat foo | head'
|
||||||
|
|
||||||
|
|
||||||
# helper function to download a file from a specific revision
|
# helper function to download a file from a specific revision
|
||||||
|
Loading…
Reference in New Issue
Block a user