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.
Unified · Split
| @@ -271,6 +271,16 @@ def main(): · 270 unmodified lines | |||
| 271 | 271 | ||
| 272 | logger.addHandler(handler) | 272 | logger.addHandler(handler) |
| 273 | 273 | ||
| 274 | python_ver = sys.version_info[:2] | ||
| 275 | if python_ver < (3,6): | ||
| 276 | logger.warning("Python 3.6 or later is required by kernel-doc") | ||
| 277 | |||
| 278 | # Return 0 here to avoid breaking compilation | ||
| 279 | sys.exit(0) | ||
| 280 | |||
| 281 | if python_ver < (3,7): | ||
| 282 | logger.warning("Python 3.7 or later is required for correct results") | ||
| 283 | |||
| 274 | if args.man: | 284 | if args.man: |
| 275 | out_style = ManFormat(modulename=args.modulename) | 285 | out_style = ManFormat(modulename=args.modulename) |
| 276 | elif args.none: | 286 | elif args.none: |