# HG changeset patch # User Augie Fackler # Date 2018-04-27 17:26:43 # Node ID 2d919ab6c5b4db1dc9348eda93ac58208436f707 # Parent f71c97d9b97b9983bdcf6b82d66beec7581bee3c posix: use inst.errno instead of inst[0] on OSError instances Differential Revision: https://phab.mercurial-scm.org/D3523 diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -287,7 +287,7 @@ def checklink(path): return True except OSError as inst: # link creation might race, try again - if inst[0] == errno.EEXIST: + if inst.errno == errno.EEXIST: continue raise finally: @@ -297,7 +297,7 @@ def checklink(path): return False except OSError as inst: # sshfs might report failure while successfully creating the link - if inst[0] == errno.EIO and os.path.exists(name): + if inst.errno == errno.EIO and os.path.exists(name): unlink(name) return False