소스 검색

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

Romain Rigaux 8 년 전
부모
커밋
0bb32201b5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/libs/metadata/src/metadata/navigator_api.py

+ 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):