Skip to content

Commit

Permalink
Handle {a} and {a,} in fnmatch.translate
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhunner committed Oct 14, 2012
1 parent e4807b1 commit bef6cc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editorconfig/fnmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ def translate(pat):
j = k
if j < n and pat[j] == ',':
j = j+1
if j >= n or j == i:
res = res + '{'
if j < n and pat[j] == '}':
groups.append('')
if j >= n or len(groups) < 2:
res = res + '\\{'
else:
res = '%s(%s)' % (res, '|'.join(map(re.escape, groups)))
i = j+1
Expand Down

0 comments on commit bef6cc5

Please sign in to comment.