diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py --- a/clang-tools-extra/clang-tidy/add_new_check.py +++ b/clang-tools-extra/clang-tidy/add_new_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# # @@ -16,6 +16,8 @@ import re import sys +assert sys.version_info >= (3,), "Requires python 3" + # Adapts the module's CMakelist file. Returns 'True' if it could add a new # entry and 'False' if the entry already existed. def adapt_cmake(module_path, check_name_camel): diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py --- a/clang-tools-extra/clang-tidy/rename_check.py +++ b/clang-tools-extra/clang-tidy/rename_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# # @@ -13,6 +13,9 @@ import io import os import re +import sys + +assert sys.version_info >= (3,), "Requires python 3" def replaceInFileRegex(fileName, sFrom, sTo): if sFrom == sTo: