Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Docs: drop Python 2 support

The kernel build system as a whole is dropping support for Python 2, so we
should do the same. The effects are rather small, especially considering
that much of the deleted code was not doing anything under any version of
Python anyway.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>

+3 -28
+1 -13
Documentation/sphinx/kfigure.py
··· 49 49 from os import path 50 50 import subprocess 51 51 from hashlib import sha1 52 - import sys 53 - 54 52 from docutils import nodes 55 53 from docutils.statemachine import ViewList 56 54 from docutils.parsers.rst import directives 57 55 from docutils.parsers.rst.directives import images 58 56 import sphinx 59 - 60 57 from sphinx.util.nodes import clean_astext 61 - from six import iteritems 62 - 63 58 import kernellog 64 - 65 - PY3 = sys.version_info[0] == 3 66 - 67 - if PY3: 68 - _unicode = str 69 - else: 70 - _unicode = unicode 71 59 72 60 # Get Sphinx version 73 61 major, minor, patch = sphinx.version_info[:3] ··· 528 540 docname = app.env.docname 529 541 labels = std.data["labels"] 530 542 531 - for name, explicit in iteritems(doctree.nametypes): 543 + for name, explicit in doctree.nametypes.items(): 532 544 if not explicit: 533 545 continue 534 546 labelid = doctree.nameids[name]
-2
Documentation/sphinx/maintainers_include.py
··· 61 61 field_content = "" 62 62 63 63 for line in open(path): 64 - if sys.version_info.major == 2: 65 - line = unicode(line, 'utf-8') 66 64 # Have we reached the end of the preformatted Descriptions text? 67 65 if descriptions and line.startswith('Maintainers'): 68 66 descriptions = False
-1
Documentation/sphinx/requirements.txt
··· 1 1 docutils 2 2 Sphinx==2.4.4 3 3 sphinx_rtd_theme 4 - six
-10
Documentation/sphinx/rstFlatTable.py
··· 42 42 # imports 43 43 # ============================================================================== 44 44 45 - import sys 46 - 47 45 from docutils import nodes 48 46 from docutils.parsers.rst import directives, roles 49 47 from docutils.parsers.rst.directives.tables import Table ··· 52 54 # ============================================================================== 53 55 54 56 __version__ = '1.0' 55 - 56 - PY3 = sys.version_info[0] == 3 57 - PY2 = sys.version_info[0] == 2 58 - 59 - if PY3: 60 - # pylint: disable=C0103, W0622 61 - unicode = str 62 - basestring = str 63 57 64 58 # ============================================================================== 65 59 def setup(app):
+2 -2
scripts/sphinx-pre-install
··· 728 728 $need_virtualenv = 1; 729 729 } 730 730 if ($1 < 3) { 731 - # Complain if it finds python2 (or worse) 732 - printf "Warning: python$1 support is deprecated. Use it with caution!\n"; 731 + # Fail if it finds python2 (or worse) 732 + die "Python 3 is required to build the kernel docs\n"; 733 733 } 734 734 } else { 735 735 die "Warning: couldn't identify $python_cmd version!";