summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/regex_helper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/utils/regex_helper.py b/django/utils/regex_helper.py
index 3e3d349433..181285da4f 100644
--- a/django/utils/regex_helper.py
+++ b/django/utils/regex_helper.py
@@ -74,7 +74,11 @@ def normalize(pattern):
# A "while" loop is used here because later on we need to be able to peek
# at the next character and possibly go around without consuming another
# one at the top of the loop.
- ch, escaped = pattern_iter.next()
+ try:
+ ch, escaped = pattern_iter.next()
+ except StopIteration:
+ return zip([''], [[]])
+
try:
while True:
if escaped: