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

login
register
mail settings
Submitter Simon Heimberg
Date June 12, 2013, 11:34 p.m.
Message ID <bc083daefc5b468586c1.1371080090@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1722/
State Rejected, archived
Headers show

Comments

Simon Heimberg - June 12, 2013, 11:34 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@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.

Patch

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