Mageia Bugzilla – Attachment 10971 Details for
Bug 24721
Many bzr commands fail due to a change in python2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch for bzrlib/lazy_regex.py
bzr_6621.diff (text/plain), 690 bytes, created by
Frédéric "LpSolit" Buclin
on 2019-04-26 11:07:11 CEST
(
hide
)
Description:
patch for bzrlib/lazy_regex.py
Filename:
MIME Type:
Creator:
Frédéric "LpSolit" Buclin
Created:
2019-04-26 11:07:11 CEST
Size:
690 bytes
patch
obsolete
>=== 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
=== 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
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24721
: 10971