summaryrefslogtreecommitdiff
path: root/sphinx/util/jsdump.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-29 07:17:14 +0200
committerGeorg Brandl <georg@python.org>2010-10-29 07:17:14 +0200
commit65505907f1f09ccc2385d21758254f9516abb5de (patch)
treec378800fe0752c942fbe63edf504126511352ea1 /sphinx/util/jsdump.py
parent51edd7e8109781e33bb2c27e1b6ee8ab74b8b62a (diff)
downloadsphinx-git-65505907f1f09ccc2385d21758254f9516abb5de.tar.gz
Fix loading JS searchindex data in Py3k.
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r--sphinx/util/jsdump.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py
index e357128c2..bfa1895f4 100644
--- a/sphinx/util/jsdump.py
+++ b/sphinx/util/jsdump.py
@@ -12,6 +12,8 @@
import re
+from sphinx.util.pycompat import u
+
_str_re = re.compile(r'"(\\\\|\\"|[^"])*"')
_int_re = re.compile(r'\d+')
_name_re = re.compile(r'[a-zA-Z]\w*')
@@ -50,7 +52,7 @@ def encode_string(s):
return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"'
def decode_string(s):
- return ESCAPED.sub(lambda m: eval('u"'+m.group()+'"'), s)
+ return ESCAPED.sub(lambda m: eval(u + '"' + m.group() + '"'), s)
reswords = set("""\