forked from luck/tmp_suning_uos_patched
096ea522e8
Recent versions of sphinx will emit messages like: Documentation/sphinx/kerneldoc.py:103: RemovedInSphinx20Warning: app.warning() is now deprecated. Use sphinx.util.logging instead. Switch to sphinx.util.logging to make this unsightly message go away. Alas, that interface was only added in version 1.6, so we have to add a version check to keep things working with older sphinxes. Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
29 lines
626 B
Python
29 lines
626 B
Python
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Sphinx has deprecated its older logging interface, but the replacement
|
|
# only goes back to 1.6. So here's a wrapper layer to keep around for
|
|
# as long as we support 1.4.
|
|
#
|
|
import sphinx
|
|
|
|
if sphinx.__version__[:3] >= '1.6':
|
|
UseLogging = True
|
|
from sphinx.util import logging
|
|
logger = logging.getLogger('kerneldoc')
|
|
else:
|
|
UseLogging = False
|
|
|
|
def warn(app, message):
|
|
if UseLogging:
|
|
logger.warning(message)
|
|
else:
|
|
app.warn(message)
|
|
|
|
def verbose(app, message):
|
|
if UseLogging:
|
|
logger.verbose(message)
|
|
else:
|
|
app.verbose(message)
|
|
|
|
|