# HG changeset patch
# Parent d3c1adf8f469f1b9447a6a47ad589f0ed430e999
Makes reversed() working with iterator types

diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -194,7 +194,8 @@
         lookups = MultiValueDict()
         namespaces = {}
         apps = {}
-        for pattern in reversed(self.url_patterns):
+        #Make sure the first argument to reversed is a sequence
+        for pattern in reversed([item for item in self.url_patterns]):
             p_pattern = pattern.regex.pattern
             if p_pattern.startswith('^'):
                 p_pattern = p_pattern[1:]
