# HG changeset patch # User Yuya Nishihara # Date 1504419361 -32400 # Node ID 0f9936d80e01259ddcacb767437816ef277d6393 # Parent a8994d08e4a289828f722edd31540458161a38df doctest: upgrade old-style "except" clause diff -r a8994d08e4a2 -r 0f9936d80e01 hgext/mq.py --- a/hgext/mq.py Sun Sep 03 14:56:31 2017 +0900 +++ b/hgext/mq.py Sun Sep 03 15:16:01 2017 +0900 @@ -155,7 +155,7 @@ def inserthgheader(lines, header, value): """Assuming lines contains a HG patch header, add a header line with value. >>> try: inserthgheader([], b'# Date ', b'z') - ... except ValueError, inst: print("oops") + ... except ValueError as inst: print("oops") oops >>> inserthgheader([b'# HG changeset patch'], b'# Date ', b'z') ['# HG changeset patch', '# Date z'] diff -r a8994d08e4a2 -r 0f9936d80e01 mercurial/dagparser.py --- a/mercurial/dagparser.py Sun Sep 03 14:56:31 2017 +0900 +++ b/mercurial/dagparser.py Sun Sep 03 15:16:01 2017 +0900 @@ -157,7 +157,7 @@ >>> from . import pycompat >>> try: list(parsedag(b'+1 bad')) - ... except Exception, e: print(pycompat.sysstr(bytes(e))) + ... except Exception as e: print(pycompat.sysstr(bytes(e))) invalid character in dag description: bad... '''