diff options
Diffstat (limited to 'utils/jssplitter_generator.py')
| -rw-r--r-- | utils/jssplitter_generator.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/utils/jssplitter_generator.py b/utils/jssplitter_generator.py index 190ab01ca..255bc0a98 100644 --- a/utils/jssplitter_generator.py +++ b/utils/jssplitter_generator.py @@ -1,11 +1,8 @@ -# -*- coding: utf-8 -*- import json import re import subprocess import sys -import six - # find char codes they are matched with Python's (?u)\\w match = re.compile(r'(?u)\w') @@ -16,7 +13,7 @@ singles = [] for i in range(65536): # 0xd800-0xdfff is surrogate pair area. skip this. - if not match.match(six.unichr(i)) and not (0xd800 <= i <= 0xdfff): + if not match.match(chr(i)) and not (0xd800 <= i <= 0xdfff): if begin == -1: begin = i elif begin != -1: @@ -114,7 +111,7 @@ console.log(' ... ok\\n') ''' % js_src -python_src = '''# -*- coding: utf-8 -*- +python_src = '''\ """ sphinx.search.jssplitter ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -136,7 +133,7 @@ with open('../sphinx/search/jssplitter.py', 'w') as f: f.write(python_src) with open('./regression_test.js', 'w') as f: - f.write(js_test_src.encode('utf-8')) + f.write(js_test_src.encode()) print("starting test...") result = subprocess.call(['node', './regression_test.js']) |
