Commit 7740f9db authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet
Browse files

docs: kernel-doc: emit warnings for ancient versions of Python



Kernel-doc requires at least version 3.6 to run, as it uses f-string.
Yet, Kernel build currently calls kernel-doc with -none on some places.
Better not to bail out when older versions are found.

Versions of Python prior to 3.7 do not guarantee to remember the insertion
order of dicts; since kernel-doc depends on that guarantee, running with
such older versions could result in output with reordered sections.

Check Python version when called via command line.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/7d7fa3a3aa1fafa0cc9ea29c889de4c7d377dca6.1752218291.git.mchehab+huawei@kernel.org
parent 2d48d3e4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -271,6 +271,16 @@ def main():

    logger.addHandler(handler)

    python_ver = sys.version_info[:2]
    if python_ver < (3,6):
        logger.warning("Python 3.6 or later is required by kernel-doc")

        # Return 0 here to avoid breaking compilation
        sys.exit(0)

    if python_ver < (3,7):
        logger.warning("Python 3.7 or later is required for correct results")

    if args.man:
        out_style = ManFormat(modulename=args.modulename)
    elif args.none: