summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-11-12 16:31:27 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2018-11-12 16:31:27 -0800
commit6fbf4a2f9919407f80cb7256e3723502f44c1f37 (patch)
tree9a48510b0e08d6bf714685d7372125e9b5547ce2
parentb6fb8083179452c0b7240653891c299b5429f990 (diff)
downloadsphinx-git-6fbf4a2f9919407f80cb7256e3723502f44c1f37.tar.gz
Deprecate sphinx.util.pycompat.u
It is now simply a constant equal to the empty string. Provides no further utility.
-rw-r--r--CHANGES1
-rw-r--r--doc/extdev/index.rst5
-rw-r--r--sphinx/util/jsdump.py4
-rw-r--r--sphinx/util/pycompat.py2
4 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index cdf469ed5..d43fe9e5e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,7 @@ Deprecated
* ``sphinx.testing.util.remove_unicode_literal()``
* ``sphinx.util.get_matching_docs()`` is deprecated
* ``sphinx.util.osutil.walk()``
+* ``sphinx.util.pycompat.u``
* ``sphinx.writers.latex.LaTeXTranslator.babel_defmacro()``
* template variables for LaTeX template
diff --git a/doc/extdev/index.rst b/doc/extdev/index.rst
index d16d792d4..e4c3dee61 100644
--- a/doc/extdev/index.rst
+++ b/doc/extdev/index.rst
@@ -158,6 +158,11 @@ The following is a list of deprecated interfaces.
- 4.0
- ``os.walk()``
+ * - ``sphinx.util.pycompat.u``
+ - 2.0
+ - 4.0
+ - N/A
+
* - ``sphinx.application.Sphinx._setting_up_extension``
- 2.0
- 3.0
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py
index 17865f956..acdeb3083 100644
--- a/sphinx/util/jsdump.py
+++ b/sphinx/util/jsdump.py
@@ -14,8 +14,6 @@ import re
from six import integer_types, string_types
-from sphinx.util.pycompat import u
-
if False:
# For type annotation
from typing import Any, Dict, IO, List, Match, Union # NOQA
@@ -62,7 +60,7 @@ def encode_string(s):
def decode_string(s):
# type: (str) -> str
- return ESCAPED.sub(lambda m: eval(u + '"' + m.group() + '"'), s)
+ return ESCAPED.sub(lambda m: eval('"' + m.group() + '"'), s)
reswords = set("""\
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py
index a33a832c8..a3521b01e 100644
--- a/sphinx/util/pycompat.py
+++ b/sphinx/util/pycompat.py
@@ -27,7 +27,7 @@ NoneType = type(None)
# Python 2/3 compatibility
# prefix for Unicode strings
-u = ''
+u = '' # RemovedInSphinx40Warning
# sys_encoding: some kind of default system encoding; should be used with