##// 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 96 err = e
97 97 status = -1
98 98 if util.safehasattr(req.ui, 'ferr'):
99 if err is not None and err.errno != errno.EPIPE:
100 req.ui.ferr.write('abort: %s\n' %
101 encoding.strtolocal(err.strerror))
102 req.ui.ferr.flush()
99 try:
100 if err is not None and err.errno != errno.EPIPE:
101 req.ui.ferr.write('abort: %s\n' %
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 109 sys.exit(status & 255)
104 110
105 111 def _initstdio():
@@ -34,15 +34,7 b' Writes to stdio succeed and fail appropr'
34 34 [255]
35 35 #endif
36 36
37 #if devfull no-chg
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
37 #if devfull
46 38 $ hg status >/dev/full 2>&1
47 39 [255]
48 40
General Comments 0
You need to be logged in to leave comments. Login now