From ee8f7539463803604e5d4121739bc2e757d48a15 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 7 May 2016 17:02:09 +0200 Subject: [PATCH] load_excludes: reuse existing clean_lines function --- borg/helpers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/borg/helpers.py b/borg/helpers.py index 999da93c5..7d8905942 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -282,8 +282,7 @@ def load_excludes(fh): """Load and parse exclude patterns from file object. Lines empty or starting with '#' after stripping whitespace on both line ends are ignored. """ - patterns = (line for line in (i.strip() for i in fh) if not line.startswith('#')) - return [parse_pattern(pattern) for pattern in patterns if pattern] + return [parse_pattern(pattern) for pattern in clean_lines(fh)] def update_excludes(args):