[PATCH 1 of 2] check-code: do not use re2 when finditer is not implemented

Simon Heimberg simohe at besonet.ch
Wed Jun 12 18:34:50 CDT 2013


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1371079524 -7200
# Node ID bc083daefc5b468586c15623e483a7e8358688b7
# Parent  e12f745ed2b4c38ac0acb2c8f7c2cebe3b130f3f
check-code: do not use re2 when finditer is not implemented

There are two implementation of re2, one missing this functionality.
As first step do not use re2 in this case.

diff -r e12f745ed2b4 -r bc083daefc5b contrib/check-code.py
--- a/contrib/check-code.py	Sam Jun 08 20:20:14 2013 +0200
+++ b/contrib/check-code.py	Don Jun 13 01:25:24 2013 +0200
@@ -12,6 +12,9 @@
 import optparse
 try:
     import re2
+    if not getattr(re2, 'finditer', None):
+        # missing in one implementation
+        re2 = None
 except ImportError:
     re2 = None
 


More information about the Mercurial-devel mailing list