comparison mercurial/pathutil.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 127a11f705d9
children d740df4e96cf
comparison
equal deleted inserted replaced
25659:d60678a567a9 25660:328739ea70c3
74 if normprefix in self.auditeddir: 74 if normprefix in self.auditeddir:
75 break 75 break
76 curpath = os.path.join(self.root, prefix) 76 curpath = os.path.join(self.root, prefix)
77 try: 77 try:
78 st = os.lstat(curpath) 78 st = os.lstat(curpath)
79 except OSError, err: 79 except OSError as err:
80 # EINVAL can be raised as invalid path syntax under win32. 80 # EINVAL can be raised as invalid path syntax under win32.
81 # They must be ignored for patterns can be checked too. 81 # They must be ignored for patterns can be checked too.
82 if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): 82 if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):
83 raise 83 raise
84 else: 84 else: