diff --git a/utils_maintenance/autopep8_format_paths.py b/utils_maintenance/autopep8_format_paths.py index 100a308364b8..36ed84bec433 100644 --- a/utils_maintenance/autopep8_format_paths.py +++ b/utils_maintenance/autopep8_format_paths.py @@ -35,7 +35,7 @@ def compute_paths(paths, use_default_paths): else: paths = [ f for f in paths - if os.path.isfile(f) and f.endswith(extensions) + if not os.path.isfile(f) or f.endswith(extensions) ] if os.sep != "/": diff --git a/utils_maintenance/clang_format_paths.py b/utils_maintenance/clang_format_paths.py index e81d487c294b..cd702e84647c 100755 --- a/utils_maintenance/clang_format_paths.py +++ b/utils_maintenance/clang_format_paths.py @@ -64,7 +64,7 @@ def compute_paths(paths, use_default_paths): # "Operating" on files that will be filtered out later on. paths = [ f for f in paths - if os.path.isfile(f) and f.endswith(extensions) + if not os.path.isfile(f) or f.endswith(extensions) ] if os.sep != "/":