diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 3675bd5167c..01300c9ba0f 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -48,15 +48,8 @@ if(CMAKE_VERSION VERSION_EQUAL "3.12" OR CMAKE_VERSION VERSION_GREATER "3.12") endif() else() find_package(PythonInterp 3 QUIET) - if(NOT PYTHONINTERP_FOUND) - set(PYTHONINTERP_FOUND "") - find_package(PythonInterp 2.7 QUIET) - if(NOT PYTHONINTERP_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") - message(WARNING "No python interpreter found - disabling matchcompiler.") - set(USE_MATCHCOMPILER_OPT "Off") - else() - message(WARNING "Support for Python 2.7 is deprecated (it went EOL in January 2020) and will be removed in Cppcheck 2.16 - please use Python 3.x instead.") - endif() + if(NOT PYTHONINTERP_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") + message(WARNING "No python interpreter found - disabling matchcompiler.") endif() if(PYTHONINTERP_FOUND) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) diff --git a/htmlreport/README.txt b/htmlreport/README.txt index 88a84a1637f..38c035e27f2 100644 --- a/htmlreport/README.txt +++ b/htmlreport/README.txt @@ -3,7 +3,7 @@ cppcheck-htmlreport This is a little utility to generate a html report of a XML file produced by cppcheck. -The utility is implemented in Python (2.7+) and requires the pygments module +The utility is implemented in Python and requires the pygments module to generate syntax highlighted source code. If you are using a Debian based Linux system, the pygments package can be installed by following command: diff --git a/releasenotes.txt b/releasenotes.txt index 5afee3d96af..94dd2493697 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -13,6 +13,7 @@ Changed interface: - Deprecations: +- The previously deprecated support for Python 2.7 has been removed. please use Python 3 instead. - Other: diff --git a/test/tools/htmlreport/test_htmlreport.py b/test/tools/htmlreport/test_htmlreport.py index 4b40650cf09..31ac670110d 100755 --- a/test/tools/htmlreport/test_htmlreport.py +++ b/test/tools/htmlreport/test_htmlreport.py @@ -8,11 +8,7 @@ import sys import tempfile -if sys.version_info < (2, 7): - # For TestCase.assertIn(). - import unittest2 as unittest -else: - import unittest +import unittest TEST_TOOLS_DIR = os.path.abspath(os.path.dirname(__file__)) ROOT_DIR = os.path.split(os.path.dirname(os.path.dirname(TEST_TOOLS_DIR)))[0] diff --git a/tools/reduce.py b/tools/reduce.py index 595aaff18c8..64ab18f7ab2 100755 --- a/tools/reduce.py +++ b/tools/reduce.py @@ -38,17 +38,10 @@ def print_info(self): print('FILE=' + self.__file) def __communicate(self, p, timeout=None, **kwargs): - if sys.version_info[0] < 3: - return p.communicate(**kwargs) - else: - return p.communicate(timeout=timeout) + return p.communicate(timeout=timeout) def runtool(self, filedata=None): - if sys.version_info[0] < 3: - class TimeoutExpired(Exception): - pass - else: - TimeoutExpired = subprocess.TimeoutExpired + TimeoutExpired = subprocess.TimeoutExpired timeout = None if self.__elapsed_time: