Code

Ticket #8725: regex_helper_r8761_with_test.diff

File regex_helper_r8761_with_test.diff, 1.2 KB (added by carljm, 6 years ago)

added regression test to patch

Line 
1Index: django/utils/regex_helper.py
2===================================================================
3--- django/utils/regex_helper.py        (revision 8761)
4+++ django/utils/regex_helper.py        (working copy)
5@@ -74,8 +74,8 @@
6     # A "while" loop is used here because later on we need to be able to peek
7     # at the next character and possibly go around without consuming another
8     # one at the top of the loop.
9-    ch, escaped = pattern_iter.next()
10     try:
11+        ch, escaped = pattern_iter.next()
12         while True:
13             if escaped:
14                 result.append(ch)
15Index: tests/regressiontests/urlpatterns_reverse/urls.py
16===================================================================
17--- tests/regressiontests/urlpatterns_reverse/urls.py   (revision 8761)
18+++ tests/regressiontests/urlpatterns_reverse/urls.py   (working copy)
19@@ -40,6 +40,7 @@
20     url(r'^(?i)test/2/?$', empty_view, name="test2"),
21     url(r'^outer/(?P<outer>\d+)/',
22             include('regressiontests.urlpatterns_reverse.included_urls')),
23+    url(r'', empty_view, name='emptyregex'),
24 
25     # This is non-reversible, but we shouldn't blow up when parsing it.
26     url(r'^(?:foo|bar)(\w+)/$', empty_view, name="disjunction"),