diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-16 23:13:02 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 23:13:02 +0900 |
commit | 36b7a2d6a4473ba81313a61c8aef6dac40f0a7af (patch) | |
tree | 032e16a9d5cf933bc840010d0a99947b16c7a72e /sphinx/util/pycompat.py | |
parent | 7bdbf50ee9ab8fe73174b3b38d38f77f42e69b0c (diff) | |
parent | 048cfb5e0ade34fef722e8f6529463d546ebf4ab (diff) | |
download | sphinx-git-36b7a2d6a4473ba81313a61c8aef6dac40f0a7af.tar.gz |
Merge pull request #5792 from tk0miya/deprecate_UnicodeMixin
Deprecate UnicodeMixin
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r-- | sphinx/util/pycompat.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 4190f44ed..d0b3443b5 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -10,12 +10,14 @@ """ import sys +import warnings from html import escape as htmlescape # NOQA from io import TextIOWrapper # NOQA from textwrap import indent # NOQA from six import text_type +from sphinx.deprecation import RemovedInSphinx40Warning from sphinx.locale import __ from sphinx.util import logging @@ -68,9 +70,13 @@ def convert_with_2to3(filepath): class UnicodeMixin: """Mixin class to handle defining the proper __str__/__unicode__ - methods in Python 2 or 3.""" + methods in Python 2 or 3. + .. deprecated:: 2.0 + """ def __str__(self): + warnings.warn('UnicodeMixin is deprecated', + RemovedInSphinx40Warning, stacklevel=2) return self.__unicode__() |