diff -r d60678a567a9 -r 328739ea70c3 mercurial/pathutil.py --- a/mercurial/pathutil.py Tue Jun 23 22:38:21 2015 -0700 +++ b/mercurial/pathutil.py Tue Jun 23 22:20:08 2015 -0700 @@ -76,7 +76,7 @@ curpath = os.path.join(self.root, prefix) try: st = os.lstat(curpath) - except OSError, err: + except OSError as err: # EINVAL can be raised as invalid path syntax under win32. # They must be ignored for patterns can be checked too. if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):