# HG changeset patch # User Matt Harbison # Date 2022-12-15 03:22:12 # Node ID a87338fe8cfa6631b2e8becf41b2d526291e98f1 # Parent 55d45d0de4e723220b33f992452fc1dc65719f4c scmposix: don't subscript IOError This warning disabling has been in place since late 2019 in 667f56d73ceb. We should have had some py3 support at the time, but both pytype complains and subscripting a real FileNotFoundError generated in `hg debugshell` crashed, so maybe this fixes a problem. It looks like all other instances of subscripting exceptions have been replaced (at least as far as greping for `== errno.` revealed). diff --git a/mercurial/scmposix.py b/mercurial/scmposix.py --- a/mercurial/scmposix.py +++ b/mercurial/scmposix.py @@ -88,7 +88,7 @@ def termsize(ui): except ValueError: pass except IOError as e: - if e[0] == errno.EINVAL: # pytype: disable=unsupported-operands + if e.errno == errno.EINVAL: pass else: raise