Prechádzať zdrojové kódy

HUE-7297 [doc] re.sub needs to be compatible with Python 2.6

Romain Rigaux 8 rokov pred
rodič
commit
0bb32201b5

+ 1 - 1
desktop/libs/metadata/src/metadata/navigator_api.py

@@ -292,7 +292,7 @@ def _augment_highlighting(query_s, records):
 
 def _highlight(pattern, string):
   pattern = re.escape(pattern)
-  return re.sub('(%s)' % pattern, '<em>\\1</em>', string, count=1, flags=re.IGNORECASE)
+  return re.compile('(%s)' % pattern, re.IGNORECASE).sub('<em>\\1</em>', string, count=1)
 
 
 def _highlight_tags(record, term):