Merge pull request #4011 from blueyed/fix-DeprecationWarning-re-u

Fix DeprecationWarning for r'…(?u)'
This commit is contained in:
Takeshi KOMIYA
2017-08-20 00:16:13 +09:00
committed by GitHub
4 changed files with 5 additions and 5 deletions

View File

@@ -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')

View File

@@ -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

View File

@@ -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

View File

@@ -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 = []