mercurial/scmutil.py
changeset 41441 b5169e79c31c
parent 41392 a728ef2f9b15
child 41442 b6673e9bdcf6
--- a/mercurial/scmutil.py	Sat Jan 26 16:53:17 2019 -0800
+++ b/mercurial/scmutil.py	Sat Jan 26 17:44:07 2019 +0900
@@ -232,9 +232,9 @@
         elif m in "zlib".split():
             ui.error(_("(is your Python install correct?)\n"))
     except IOError as inst:
-        if util.safehasattr(inst, "code"):
+        if util.safehasattr(inst, "code"): # HTTPError
             ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst))
-        elif util.safehasattr(inst, "reason"):
+        elif util.safehasattr(inst, "reason"): # URLError or SSLError
             try: # usually it is in the form (errno, strerror)
                 reason = inst.reason.args[1]
             except (AttributeError, IndexError):
@@ -247,14 +247,14 @@
         elif (util.safehasattr(inst, "args")
               and inst.args and inst.args[0] == errno.EPIPE):
             pass
-        elif getattr(inst, "strerror", None):
+        elif getattr(inst, "strerror", None): # common IOError
             if getattr(inst, "filename", None):
                 ui.error(_("abort: %s: %s\n") % (
                     encoding.strtolocal(inst.strerror),
                     stringutil.forcebytestr(inst.filename)))
             else:
                 ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror))
-        else:
+        else: # suspicious IOError
             raise
     except OSError as inst:
         if getattr(inst, "filename", None) is not None: