diff --git a/build/sage_bootstrap/uncompress/filter_os_files.py b/build/sage_bootstrap/uncompress/filter_os_files.py index db05e4303ae..f6d99ee3280 100644 --- a/build/sage_bootstrap/uncompress/filter_os_files.py +++ b/build/sage_bootstrap/uncompress/filter_os_files.py @@ -1,19 +1,16 @@ """ Filtering out OS-specific files """ - -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2016 Volker Braun # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** - +# https://www.gnu.org/licenses/ +# **************************************************************************** import os -import sys def filter_os_files(filenames): @@ -23,7 +20,6 @@ def filter_os_files(filenames): Currently removes OSX .DS_Store files and AppleDouble format ._ files. """ - files_set = set(filenames) def is_os_file(path): @@ -45,10 +41,4 @@ def is_os_file(path): return False - filenames = filter(lambda f: not is_os_file(f), filenames) - - if sys.version_info[0] == 2: - return filenames - else: - # Make sure to return a list on Python >= 3 - return list(filenames) + return [f for f in filenames if not is_os_file(f)]