changeset 37994:e9c588802529

dispatch: minor code refactor This hopefully makes things slightly easier to read. Differential Revision: https://phab.mercurial-scm.org/D3537
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 11 May 2018 21:23:48 -0700
parents 623dc2651d26
children 6f9ac3cb0987
files mercurial/dispatch.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Apr 04 21:17:55 2018 +0900
+++ b/mercurial/dispatch.py	Fri May 11 21:23:48 2018 -0700
@@ -87,16 +87,19 @@
     req = request(pycompat.sysargv[1:])
     err = None
     try:
-        status = (dispatch(req) or 0)
+        status = dispatch(req) or 0
     except error.StdioError as e:
         err = e
         status = -1
+
+    # In all cases we try to flush stdio streams.
     if util.safehasattr(req.ui, 'fout'):
         try:
             req.ui.fout.flush()
         except IOError as e:
             err = e
             status = -1
+
     if util.safehasattr(req.ui, 'ferr'):
         try:
             if err is not None and err.errno != errno.EPIPE: