summarylogtreecommitdiffstats
path: root/bzr-lazy-regex.patch
diff options
context:
space:
mode:
authorMarcell Meszaros2022-07-02 23:39:31 +0200
committerMarcell Meszaros2022-07-02 23:47:49 +0200
commit24c47a8a1ffcb731f021f0e43979bb10ca4f064a (patch)
tree0b7f5f3d557750b9b74b819ac91e64c74d6ce742 /bzr-lazy-regex.patch
parent6359157ac73b141cb5454dc5029f2e731a4dfb5b (diff)
downloadaur-bzr.tar.gz
2.7.0-3 (2018-11-09 22:28:38 +0000)
This reverts commit 6359157ac73b141cb5454dc5029f2e731a4dfb5b.
Diffstat (limited to 'bzr-lazy-regex.patch')
-rw-r--r--bzr-lazy-regex.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/bzr-lazy-regex.patch b/bzr-lazy-regex.patch
new file mode 100644
index 000000000000..8c547e7e4013
--- /dev/null
+++ b/bzr-lazy-regex.patch
@@ -0,0 +1,20 @@
+diff -u bzrlib/lazy_regex.py bzrlib/lazy_regex.py
+--- bzrlib/lazy_regex.py 2017-01-15 20:36:48 +0000
++++ bzrlib/lazy_regex.py 2017-01-30 09:08:25 +0000
+@@ -1,4 +1,4 @@
+-# Copyright (C) 2006 Canonical Ltd
++# Copyright (C) 2006, 2008-2011, 2017 Canonical Ltd
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -133,0 +134,10 @@
++
++
++# 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