Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commandserver.py @ 25660:328739ea70c3
global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".
This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.
This patch was produced by running `2to3 -f except -w -n .`.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 23 Jun 2015 22:20:08 -0700 |
parents | 69f86b937035 |
children | 5857be01962e |
comparison
equal
deleted
inserted
replaced
25659:d60678a567a9 | 25660:328739ea70c3 |
---|---|
298 try: | 298 try: |
299 try: | 299 try: |
300 sv.serve() | 300 sv.serve() |
301 # handle exceptions that may be raised by command server. most of | 301 # handle exceptions that may be raised by command server. most of |
302 # known exceptions are caught by dispatch. | 302 # known exceptions are caught by dispatch. |
303 except util.Abort, inst: | 303 except util.Abort as inst: |
304 ui.warn(_('abort: %s\n') % inst) | 304 ui.warn(_('abort: %s\n') % inst) |
305 except IOError, inst: | 305 except IOError as inst: |
306 if inst.errno != errno.EPIPE: | 306 if inst.errno != errno.EPIPE: |
307 raise | 307 raise |
308 except KeyboardInterrupt: | 308 except KeyboardInterrupt: |
309 pass | 309 pass |
310 except: # re-raises | 310 except: # re-raises |