mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4011 from blueyed/fix-DeprecationWarning-re-u
Fix DeprecationWarning for r'…(?u)'
This commit is contained in:
@@ -294,7 +294,7 @@ logger = logging.getLogger(__name__)
|
||||
_integer_literal_re = re.compile(r'-?[1-9][0-9]*')
|
||||
_float_literal_re = re.compile(r'[+-]?[0-9]*\.[0-9]+')
|
||||
_identifier_re = re.compile(r'(~?\b[a-zA-Z_][a-zA-Z0-9_]*)\b')
|
||||
_whitespace_re = re.compile(r'\s+(?u)')
|
||||
_whitespace_re = re.compile(r'(?u)\s+')
|
||||
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
_visibility_re = re.compile(r'\b(public|private|protected)\b')
|
||||
|
||||
@@ -65,7 +65,7 @@ var Stemmer = function() {
|
||||
}
|
||||
""" # type: unicode
|
||||
|
||||
_word_re = re.compile(r'\w+(?u)')
|
||||
_word_re = re.compile(r'(?u)\w+')
|
||||
|
||||
def __init__(self, options):
|
||||
# type: (Dict) -> None
|
||||
|
||||
@@ -233,7 +233,7 @@ class SearchChinese(SearchLanguage):
|
||||
language_name = 'Chinese'
|
||||
js_stemmer_code = js_porter_stemmer
|
||||
stopwords = english_stopwords
|
||||
latin1_letters = re.compile(r'\w+(?u)[\u0000-\u00ff]')
|
||||
latin1_letters = re.compile(r'(?u)\w+[\u0000-\u00ff]')
|
||||
|
||||
def init(self, options):
|
||||
# type: (Dict) -> None
|
||||
|
||||
@@ -5,9 +5,9 @@ import subprocess
|
||||
import sys
|
||||
import six
|
||||
|
||||
# find char codes they are matched with Python's \\w(?u)
|
||||
# find char codes they are matched with Python's (?u)\\w
|
||||
|
||||
match = re.compile(r'\w(?u)')
|
||||
match = re.compile(r'(?u)\w')
|
||||
begin = -1
|
||||
|
||||
ranges = []
|
||||
|
||||
Reference in New Issue
Block a user