From 7bdffde804534147eb835a6fd51e5c14d271379d Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Wed, 25 Jul 2018 19:01:28 +0530 Subject: [PATCH] build: replace exclude with filter during source tar creation Replace the deprecated exclude argument with filter in build.py allowing users of Python 3.7 to use the fdroid CLI Closes #531 --- fdroidserver/build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 7dbc326d..e11b583d 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -568,9 +568,9 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext tarname = common.getsrcname(app, build) tarball = tarfile.open(os.path.join(tmp_dir, tarname), "w:gz") - def tarexc(f): - return any(f.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr']) - tarball.add(build_dir, tarname, exclude=tarexc) + def tarexc(t): + return None if any(t.name.endswith(s) for s in ['.svn', '.git', '.hg', '.bzr']) else t + tarball.add(build_dir, tarname, filter=tarexc) tarball.close() # Run a build command if one is required...