-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #34649: remove one trace of python2
in one build script URL: https://trac.sagemath.org/34649 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Matthias Koeppe
- Loading branch information
Showing
1 changed file
with
4 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
""" | ||
Filtering out OS-specific files | ||
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2016 Volker Braun <[email protected]> | ||
# | ||
# 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)] |