Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 19461:dd7c992d3cc1
util: check if re2 works before using it (issue 3964)
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Mon, 01 Jul 2013 06:50:58 +0200 |
parents | 8b04e1344111 |
children | 887ffa22fd0d a1237a4b437d |
line wrap: on
line diff
--- a/mercurial/util.py Thu Jul 18 23:22:59 2013 -0500 +++ b/mercurial/util.py Mon Jul 01 06:50:58 2013 +0200 @@ -673,8 +673,8 @@ global _re2 if _re2 is None: try: - re2.compile - _re2 = True + # check if match works, see issue3964 + _re2 = bool(re2.match(r'\[([^\[]+)\]', '[ui]')) except ImportError: _re2 = False if _re2 and (flags & ~(re.IGNORECASE | re.MULTILINE)) == 0: