# HG changeset patch # User Gregory Szorc # Date 1548528790 28800 # Node ID 2bf689b13a17fceecfc6318e6ff42b2b623bd17b # Parent 9b3be572ff0c20129e22557685a5ed89e7ce1a59 statichttprepo: use URLError.reason directly 0b3f4be5c5bf changed str(inst) to inst.reason[0] all the way back in 2006. URLError.reason is a str and we should have taken that attribute in its entirety. I think the code was supposed to be inst.args[1] for compatibility with ancient Python versions. Python 2.7 always sets .reason, so it should be safe to use directly. Differential Revision: https://phab.mercurial-scm.org/D5715 diff -r 9b3be572ff0c -r 2bf689b13a17 mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py Sat Jan 26 10:40:37 2019 -0800 +++ b/mercurial/statichttprepo.py Sat Jan 26 10:53:10 2019 -0800 @@ -59,7 +59,7 @@ num = inst.code == 404 and errno.ENOENT or None raise IOError(num, inst) except urlerr.urlerror as inst: - raise IOError(None, inst.reason[1]) + raise IOError(None, inst.reason) if code == 200: # HTTPRangeHandler does nothing if remote does not support