diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -44,17 +44,7 @@ if (LIBCXX_STANDALONE_BUILD) find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) - message(WARNING "Python3 not found, using python2 as a fallback") - find_package(Python2 COMPONENTS Interpreter REQUIRED) - if(Python2_VERSION VERSION_LESS 2.7) - message(SEND_ERROR "Python 2.7 or newer is required") - endif() - - # Treat python2 as python3 - add_executable(Python3::Interpreter IMPORTED) - set_target_properties(Python3::Interpreter PROPERTIES - IMPORTED_LOCATION ${Python2_EXECUTABLE}) - set(Python3_EXECUTABLE ${Python2_EXECUTABLE}) + message(SEND_ERROR "Python3 not found. Python3 is required") endif() endif() diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt --- a/libcxx/utils/ci/runtimes/CMakeLists.txt +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt @@ -3,17 +3,7 @@ find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) - message(WARNING "Python3 not found, using python2 as a fallback") - find_package(Python2 COMPONENTS Interpreter REQUIRED) - if(Python2_VERSION VERSION_LESS 2.7) - message(SEND_ERROR "Python 2.7 or newer is required") - endif() - - # Treat python2 as python3 - add_executable(Python3::Interpreter IMPORTED) - set_target_properties(Python3::Interpreter PROPERTIES - IMPORTED_LOCATION ${Python2_EXECUTABLE}) - set(Python3_EXECUTABLE ${Python2_EXECUTABLE}) + message(SEND_ERROR "Python3 not found. Python3 is required") endif() # This needs to be set before we add any Lit target for `add_lit_target` to diff --git a/libcxx/utils/gdb/libcxx/printers.py b/libcxx/utils/gdb/libcxx/printers.py --- a/libcxx/utils/gdb/libcxx/printers.py +++ b/libcxx/utils/gdb/libcxx/printers.py @@ -147,10 +147,6 @@ self.count += 1 return ("[%d]" % self.count, child) - # TODO Delete when we drop Python 2. - def next(self): - return self.__next__() - def __init__(self, val): self.val = val @@ -370,10 +366,6 @@ self.offset = 0 return ("[%d]" % self.count, outbit) - # TODO Delete when we drop Python 2. - def next(self): - return self.__next__() - class _VectorIterator(object): """Class to iterate over the non-bool vector's children.""" @@ -393,10 +385,6 @@ self.item += 1 return ("[%d]" % self.count, entry) - # TODO Delete when we drop Python 2. - def next(self): - return self.__next__() - def __init__(self, val): """Set val, length, capacity, and iterator for bool and normal vectors.""" self.val = val diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py --- a/libcxx/utils/ssh.py +++ b/libcxx/utils/ssh.py @@ -23,11 +23,7 @@ import tarfile import tempfile -try: - from shlex import quote as cmd_quote -except ImportError: - # for Python 2 compatibility - from pipes import quote as cmd_quote +from shlex import quote as cmd_quote def ssh(args, command): cmd = ['ssh', '-oBatchMode=yes']