Skip to content

Commit

Permalink
Merge pull request bottlepy#515 from zhangyangyu/master
Browse files Browse the repository at this point in the history
Fixed _re_flatten pattern. Not a bug, just to be more correct.
  • Loading branch information
defnull committed Jun 22, 2013
2 parents 6585296 + a9f2029 commit 425152c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _re_flatten(p):
''' Turn all capturing groups in a regular expression pattern into
non-capturing groups. '''
if '(' not in p: return p
return re.sub(r'(\\*)(\(\?P<[^>]*>|\((?!\?))',
return re.sub(r'(\\*)(\(\?P<[^>]+>|\((?!\?))',
lambda m: m.group(0) if len(m.group(1)) % 2 else m.group(1) + '(?:', p)


Expand Down

0 comments on commit 425152c

Please sign in to comment.