Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > f0593b35c8eb4be79852e028b8d0c584 > files > 2

bzr-2.7.0-6.mga7.src.rpm

=== modified file 'bzrlib/lazy_regex.py'
--- bzrlib/lazy_regex.py	2011-12-19 13:23:58 +0000
+++ bzrlib/lazy_regex.py	2017-01-15 20:36:48 +0000
@@ -131,3 +131,13 @@
     raise AssertionError(
         "re.compile has already been overridden as lazy_compile, but this would" \
         " cause infinite recursion")
+
+
+# Some libraries calls re.finditer which fails it if receives a LazyRegex.
+if getattr(re, 'finditer', False):
+    def finditer_public(pattern, string, flags=0):
+        if isinstance(pattern, LazyRegex):
+            return pattern.finditer(string)
+        else:
+            return _real_re_compile(pattern, flags).finditer(string)
+    re.finditer = finditer_public