diff -r d60678a567a9 -r 328739ea70c3 mercurial/fileset.py --- a/mercurial/fileset.py Tue Jun 23 22:38:21 2015 -0700 +++ b/mercurial/fileset.py Tue Jun 23 22:20:08 2015 -0700 @@ -280,7 +280,7 @@ try: # i18n: "grep" is a keyword r = re.compile(getstring(x, _("grep requires a pattern"))) - except re.error, e: + except re.error as e: raise error.ParseError(_('invalid match pattern: %s') % e) return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())]