1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-21 21:57:36 +00:00

patterns: explicate translate source

This commit is contained in:
Marian Beermann 2017-05-01 17:02:10 +02:00
parent 580496b592
commit c5e3232187

View file

@ -1,11 +1,11 @@
import argparse
import fnmatch
import os.path
import re
import sys
import unicodedata
from collections import namedtuple
from enum import Enum
from fnmatch import translate
from . import shellpattern
from .helpers import clean_lines
@ -258,7 +258,7 @@ def _prepare(self, pattern):
# fnmatch and re.match both cache compiled regular expressions.
# Nevertheless, this is about 10 times faster.
self.regex = re.compile(translate(self.pattern))
self.regex = re.compile(fnmatch.translate(self.pattern))
def _match(self, path):
return (self.regex.match(path + os.path.sep) is not None)