Skip to content

Commit

Permalink
Trac #34649: remove one trace of python2
Browse files Browse the repository at this point in the history
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
Release Manager committed Oct 16, 2022
2 parents 9afd269 + 86f8a14 commit 66ad265
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions build/sage_bootstrap/uncompress/filter_os_files.py
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):
Expand All @@ -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):
Expand All @@ -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)]

0 comments on commit 66ad265

Please sign in to comment.