diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-19 01:58:16 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-19 01:58:16 +0900 |
commit | a6a38c803f81782b51bdd7eaf8a22488044c5c23 (patch) | |
tree | 34ec213c6fd351951a41e2c783ee2fc352df26da | |
parent | c78018cda7f32b060966d57af0c5cef1880e89c0 (diff) | |
download | sphinx-git-a6a38c803f81782b51bdd7eaf8a22488044c5c23.tar.gz |
Suppress deprecation warning for autosummary
-rw-r--r-- | sphinx/ext/autosummary/generate.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index b6ced2256..5419e41df 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -208,23 +208,25 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst', if info: warnings.warn('info argument for generate_autosummary_docs() is deprecated.', RemovedInSphinx40Warning) + _info = info else: - info = logger.info + _info = logger.info if warn: warnings.warn('warn argument for generate_autosummary_docs() is deprecated.', RemovedInSphinx40Warning) + _warn = warn else: - warn = logger.warning + _warn = logger.warning showed_sources = list(sorted(sources)) if len(showed_sources) > 20: showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:] - info(__('[autosummary] generating autosummary for: %s') % - ', '.join(showed_sources)) + _info(__('[autosummary] generating autosummary for: %s') % + ', '.join(showed_sources)) if output_dir: - info(__('[autosummary] writing to %s') % output_dir) + _info(__('[autosummary] writing to %s') % output_dir) if base_path is not None: sources = [os.path.join(base_path, filename) for filename in sources] @@ -250,7 +252,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst', try: name, obj, parent, mod_name = import_by_name(name) except ImportError as e: - warn('[autosummary] failed to import %r: %s' % (name, e)) + _warn('[autosummary] failed to import %r: %s' % (name, e)) continue fn = os.path.join(path, name + suffix) |