Explorar o código

Merge pull request #1023 from ThomasWaldmann/use-clean-lines

load_excludes: reuse existing clean_lines function
TW %!s(int64=9) %!d(string=hai) anos
pai
achega
7214c36ac2
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      borg/helpers.py

+ 1 - 2
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):