summaryrefslogtreecommitdiff
path: root/sphinx/util/pycompat.py
diff options
context:
space:
mode:
authorPeter Bell <peterbell10@live.co.uk>2020-07-16 15:48:51 +0100
committerPeter Bell <peterbell10@live.co.uk>2020-07-16 15:48:51 +0100
commit00002397764b391b0ebf737bbe47202ed4c98fff (patch)
tree1c4378850ab1461ac189e0690aceb88e59c44a04 /sphinx/util/pycompat.py
parentea0fbd21d5e0c498cf13e338a1ed3dd64d15d4f3 (diff)
downloadsphinx-git-00002397764b391b0ebf737bbe47202ed4c98fff.tar.gz
Preserve backwards compatibility
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r--sphinx/util/pycompat.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py
index 6ec180f0b..50eee5ce3 100644
--- a/sphinx/util/pycompat.py
+++ b/sphinx/util/pycompat.py
@@ -15,8 +15,7 @@ import textwrap
import warnings
from typing import Any, Callable
-from sphinx.deprecation import (
- RemovedInSphinx40Warning, deprecated_alias, deprecated_attribute)
+from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.console import terminal_safe
@@ -92,13 +91,20 @@ def execfile_(filepath: str, _globals: Any, open: Callable = open) -> None:
deprecated_alias('sphinx.util.pycompat',
{
- 'NoneType': ('sphinx.util.typing.NoneType', NoneType),
- 'TextIOWrapper': ('io.TextIOWrapper', io.TextIOWrapper),
- 'htmlescape': ('html.escape', html.escape),
- 'indent': ('textwrap.indent', textwrap.indent),
- 'terminal_safe': ('sphinx.util.console.terminal_safe', terminal_safe),
- 'sys_encoding': ('sys.getdefaultencoding', sys.getdefaultencoding()),
+ 'NoneType': NoneType,
+ 'TextIOWrapper': io.TextIOWrapper,
+ 'htmlescape': html.escape,
+ 'indent': textwrap.indent,
+ 'terminal_safe': terminal_safe,
+ 'sys_encoding': sys.getdefaultencoding(),
+ 'u': '',
},
- RemovedInSphinx40Warning)
-
-deprecated_attribute('sphinx.util.pycompat', {'u': ''}, RemovedInSphinx40Warning)
+ RemovedInSphinx40Warning,
+ {
+ 'NoneType': 'sphinx.util.typing.NoneType',
+ 'TextIOWrapper': 'io.TextIOWrapper',
+ 'htmlescape': 'html.escape',
+ 'indent': 'textwrap.indent',
+ 'terminal_safe': 'sphinx.util.console.terminal_safe',
+ 'sys_encoding': 'sys.getdefaultencoding',
+ })