summaryrefslogtreecommitdiff
path: root/sphinx/util/pycompat.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-15 22:50:47 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-16 01:41:58 +0900
commitd0cff3b4fc564cadfc51bb05638ef71c1b1b1425 (patch)
tree825c3f2282200375d690df2d103ae5ea2c2ca5ce /sphinx/util/pycompat.py
parent01eb6a68cd7e3657082e81a725c4ecbd34fc598f (diff)
downloadsphinx-git-d0cff3b4fc564cadfc51bb05638ef71c1b1b1425.tar.gz
Deprecate sphinx.util.pycompat.execfile_()
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r--sphinx/util/pycompat.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py
index 061bbcb6d..88e9ac8d5 100644
--- a/sphinx/util/pycompat.py
+++ b/sphinx/util/pycompat.py
@@ -15,7 +15,9 @@ import textwrap
import warnings
from typing import Any, Callable
-from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
+from sphinx.deprecation import (
+ RemovedInSphinx40Warning, RemovedInSphinx60Warning, deprecated_alias
+)
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.console import terminal_safe
@@ -31,6 +33,9 @@ logger = logging.getLogger(__name__)
# convert_with_2to3():
# support for running 2to3 over config files
def convert_with_2to3(filepath: str) -> str:
+ warnings.warn('convert_with_2to3() is deprecated',
+ RemovedInSphinx60Warning, stacklevel=2)
+
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
from lib2to3.pgen2.parse import ParseError
fixers = get_fixers_from_package('lib2to3.fixes')
@@ -59,6 +64,8 @@ class UnicodeMixin:
def execfile_(filepath: str, _globals: Any, open: Callable = open) -> None:
+ warnings.warn('execfile_() is deprecated',
+ RemovedInSphinx60Warning, stacklevel=2)
from sphinx.util.osutil import fs_encoding
with open(filepath, 'rb') as f:
source = f.read()