diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-07-02 21:51:33 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-07-02 21:51:33 +0900 |
commit | 4a5ee3921b6e9fcd3116f6ecbfbdbdff903dba91 (patch) | |
tree | 1d38579d42178ebbb44178d676bdb3626c44b365 /sphinx/util/compat.py | |
parent | 007593fa810918f243223080598d7ef74fd48fe9 (diff) | |
download | sphinx-git-4a5ee3921b6e9fcd3116f6ecbfbdbdff903dba91.tar.gz |
Remove sphinx.util.compat again (rebirthed on merging)
Diffstat (limited to 'sphinx/util/compat.py')
-rw-r--r-- | sphinx/util/compat.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/sphinx/util/compat.py b/sphinx/util/compat.py deleted file mode 100644 index 3a5356ff7..000000000 --- a/sphinx/util/compat.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -""" - sphinx.util.compat - ~~~~~~~~~~~~~~~~~~ - - Stuff for docutils compatibility. - - :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" -from __future__ import absolute_import - -import sys -import warnings -from distutils.version import LooseVersion - -from docutils.parsers.rst import Directive # noqa -from docutils import __version__ as _du_version - -from sphinx.deprecation import RemovedInSphinx17Warning - -docutils_version = tuple(LooseVersion(_du_version).version)[:2] - -if False: - # For type annotation - from typing import Any, Dict # NOQA - - -class _DeprecationWrapper(object): - def __init__(self, mod, deprecated): - # type: (Any, Dict) -> None - self._mod = mod - self._deprecated = deprecated - - def __getattr__(self, attr): - # type: (str) -> Any - if attr in self._deprecated: - warnings.warn("sphinx.util.compat.%s is deprecated and will be removed " - "in Sphinx 1.7, please use docutils' instead." % attr, - RemovedInSphinx17Warning) - return self._deprecated[attr] - return getattr(self._mod, attr) - - -sys.modules[__name__] = _DeprecationWrapper(sys.modules[__name__], dict( # type: ignore - docutils_version = docutils_version, - Directive = Directive, -)) |