# HG changeset patch # User Brodie Rao # Date 1285200927 18000 # Node ID 9a93f4fb141b89412084fcd23a03a09b11d43fbf # Parent ffcceca7406d2de072da84affcab6b08736ae94a grep: only catch re.error when compiling regular expressions diff -r ffcceca7406d -r 9a93f4fb141b mercurial/commands.py --- a/mercurial/commands.py Thu Sep 23 00:27:04 2010 -0600 +++ b/mercurial/commands.py Wed Sep 22 19:15:27 2010 -0500 @@ -1569,7 +1569,7 @@ reflags |= re.I try: regexp = re.compile(pattern, reflags) - except Exception, inst: + except re.error, inst: ui.warn(_("grep: invalid match pattern: %s\n") % inst) return 1 sep, eol = ':', '\n'