##// END OF EJS Templates
dispatch: handle IOError when writing to stderr...
Gregory Szorc -
r35671:48fe4f56 default
parent child Browse files
Show More
@@ -96,10 +96,16 b' def run():'
96 err = e
96 err = e
97 status = -1
97 status = -1
98 if util.safehasattr(req.ui, 'ferr'):
98 if util.safehasattr(req.ui, 'ferr'):
99 if err is not None and err.errno != errno.EPIPE:
99 try:
100 req.ui.ferr.write('abort: %s\n' %
100 if err is not None and err.errno != errno.EPIPE:
101 encoding.strtolocal(err.strerror))
101 req.ui.ferr.write('abort: %s\n' %
102 req.ui.ferr.flush()
102 encoding.strtolocal(err.strerror))
103 req.ui.ferr.flush()
104 # There's not much we can do about an I/O error here. So (possibly)
105 # change the status code and move on.
106 except IOError:
107 status = -1
108
103 sys.exit(status & 255)
109 sys.exit(status & 255)
104
110
105 def _initstdio():
111 def _initstdio():
@@ -34,15 +34,7 b' Writes to stdio succeed and fail appropr'
34 [255]
34 [255]
35 #endif
35 #endif
36
36
37 #if devfull no-chg
37 #if devfull
38 $ hg status >/dev/full 2>&1
39 [1]
40
41 $ hg status ENOENT 2>/dev/full
42 [1]
43 #endif
44
45 #if devfull chg
46 $ hg status >/dev/full 2>&1
38 $ hg status >/dev/full 2>&1
47 [255]
39 [255]
48
40
General Comments 0
You need to be logged in to leave comments. Login now