From 6db9cafdec666b288cf3554be8fa81d3e5405900 Mon Sep 17 00:00:00 2001 From: Ben Doherty Date: Thu, 26 May 2016 23:49:32 -0400 Subject: [PATCH] Don't use if else syntax --- files/archive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/archive.py b/files/archive.py index 87840ec07cd..3b4a512ba4f 100644 --- a/files/archive.py +++ b/files/archive.py @@ -223,7 +223,11 @@ def main(): if os.path.isdir(path) and not path.endswith(os.sep + '.'): basename = os.path.basename(path) + os.sep - archive.add(path, path[len(arcroot):], filter=lambda f: f if f.name != creates else None) + filter_create = lambda f: + if filecmp.cmp(f.name, creates): + return f + + archive.add(path, path[len(arcroot):], filter=filter_create) successes.append(path) # Slightly more difficult (and less efficient!) compression using zipfile module