Mercurial > public > mercurial-scm > hg
comparison mercurial/worker.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 | b3e51675f98e |
children | 2d76f8a2d831 |
comparison
equal
deleted
inserted
replaced
25659:d60678a567a9 | 25660:328739ea70c3 |
---|---|
99 def killworkers(): | 99 def killworkers(): |
100 # if one worker bails, there's no good reason to wait for the rest | 100 # if one worker bails, there's no good reason to wait for the rest |
101 for p in pids: | 101 for p in pids: |
102 try: | 102 try: |
103 os.kill(p, signal.SIGTERM) | 103 os.kill(p, signal.SIGTERM) |
104 except OSError, err: | 104 except OSError as err: |
105 if err.errno != errno.ESRCH: | 105 if err.errno != errno.ESRCH: |
106 raise | 106 raise |
107 def waitforworkers(): | 107 def waitforworkers(): |
108 for _pid in pids: | 108 for _pid in pids: |
109 st = _exitstatus(os.wait()[1]) | 109 st = _exitstatus(os.wait()[1]) |