Deprecate sphinx.util.pycompat.u

It is now simply a constant equal to the empty string. Provides no
further utility.
This commit is contained in:
Jon Dufresne 2018-11-12 16:31:27 -08:00
parent b6fb808317
commit 6fbf4a2f99
4 changed files with 8 additions and 4 deletions

View File

@ -27,6 +27,7 @@ Deprecated
* ``sphinx.testing.util.remove_unicode_literal()`` * ``sphinx.testing.util.remove_unicode_literal()``
* ``sphinx.util.get_matching_docs()`` is deprecated * ``sphinx.util.get_matching_docs()`` is deprecated
* ``sphinx.util.osutil.walk()`` * ``sphinx.util.osutil.walk()``
* ``sphinx.util.pycompat.u``
* ``sphinx.writers.latex.LaTeXTranslator.babel_defmacro()`` * ``sphinx.writers.latex.LaTeXTranslator.babel_defmacro()``
* template variables for LaTeX template * template variables for LaTeX template

View File

@ -158,6 +158,11 @@ The following is a list of deprecated interfaces.
- 4.0 - 4.0
- ``os.walk()`` - ``os.walk()``
* - ``sphinx.util.pycompat.u``
- 2.0
- 4.0
- N/A
* - ``sphinx.application.Sphinx._setting_up_extension`` * - ``sphinx.application.Sphinx._setting_up_extension``
- 2.0 - 2.0
- 3.0 - 3.0

View File

@ -14,8 +14,6 @@ import re
from six import integer_types, string_types from six import integer_types, string_types
from sphinx.util.pycompat import u
if False: if False:
# For type annotation # For type annotation
from typing import Any, Dict, IO, List, Match, Union # NOQA from typing import Any, Dict, IO, List, Match, Union # NOQA
@ -62,7 +60,7 @@ def encode_string(s):
def decode_string(s): def decode_string(s):
# type: (str) -> str # type: (str) -> str
return ESCAPED.sub(lambda m: eval(u + '"' + m.group() + '"'), s) return ESCAPED.sub(lambda m: eval('"' + m.group() + '"'), s)
reswords = set("""\ reswords = set("""\

View File

@ -27,7 +27,7 @@ NoneType = type(None)
# Python 2/3 compatibility # Python 2/3 compatibility
# prefix for Unicode strings # prefix for Unicode strings
u = '' u = '' # RemovedInSphinx40Warning
# sys_encoding: some kind of default system encoding; should be used with # sys_encoding: some kind of default system encoding; should be used with