Commits

Brodie Rao committed 9a93f4f

grep: only catch re.error when compiling regular expressions

Comments (0)

Files changed (1)

mercurial/commands.py

         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'