Loading django/utils/regex_helper.py +6 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ should be good enough for a large class of URLS, however. from __future__ import unicode_literals from django.utils import six from django.utils.six.moves import zip # Mapping of an escape character to a representative of that class. So, e.g., # "\w" is replaced by "x" in a reverse URL. A value of None means to ignore Loading Loading @@ -44,8 +45,8 @@ class NonCapture(list): def normalize(pattern): """ Given a reg-exp pattern, normalizes it to a list of forms that suffice for reverse matching. This does the following: Given a reg-exp pattern, normalizes it to an iterable of forms that suffice for reverse matching. This does the following: (1) For any repeating sections, keeps the minimum number of occurrences permitted (this means zero for optional groups). Loading Loading @@ -80,7 +81,7 @@ def normalize(pattern): try: ch, escaped = next(pattern_iter) except StopIteration: return zip([''], [[]]) return [('', [])] try: while True: Loading Loading @@ -193,9 +194,9 @@ def normalize(pattern): pass except NotImplementedError: # A case of using the disjunctive form. No results for you! return zip([''], [[]]) return [('', [])] return zip(*flatten_result(result)) return list(zip(*flatten_result(result))) def next_char(input_iter): """ Loading Loading
django/utils/regex_helper.py +6 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ should be good enough for a large class of URLS, however. from __future__ import unicode_literals from django.utils import six from django.utils.six.moves import zip # Mapping of an escape character to a representative of that class. So, e.g., # "\w" is replaced by "x" in a reverse URL. A value of None means to ignore Loading Loading @@ -44,8 +45,8 @@ class NonCapture(list): def normalize(pattern): """ Given a reg-exp pattern, normalizes it to a list of forms that suffice for reverse matching. This does the following: Given a reg-exp pattern, normalizes it to an iterable of forms that suffice for reverse matching. This does the following: (1) For any repeating sections, keeps the minimum number of occurrences permitted (this means zero for optional groups). Loading Loading @@ -80,7 +81,7 @@ def normalize(pattern): try: ch, escaped = next(pattern_iter) except StopIteration: return zip([''], [[]]) return [('', [])] try: while True: Loading Loading @@ -193,9 +194,9 @@ def normalize(pattern): pass except NotImplementedError: # A case of using the disjunctive form. No results for you! return zip([''], [[]]) return [('', [])] return zip(*flatten_result(result)) return list(zip(*flatten_result(result))) def next_char(input_iter): """ Loading