From: Petri Lehtinen <petri.lehtinen@inoi.fi>
Date: Tue, 23 Feb 2010 16:45:51 +0200
Subject: [PATCH] Return unnamed captures from sub-URLconfs if there are no named captures.

Partially fixes #12943.
---
 django/core/urlresolvers.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index a924afe..43725bf 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -229,10 +229,14 @@ class RegexURLResolver(object):
                 else:
                     if sub_match:
                         sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
+                        if not sub_match_dict:
+                            sub_match_args = tuple(match.groups() + sub_match[1])
+                        else:
+                            sub_match_args = ()
                         sub_match_dict.update(self.default_kwargs)
                         for k, v in sub_match[2].iteritems():
                             sub_match_dict[smart_str(k)] = v
-                        return sub_match[0], sub_match[1], sub_match_dict
+                        return sub_match[0], sub_match_args, sub_match_dict
                     tried.append(pattern.regex.pattern)
             raise Resolver404, {'tried': tried, 'path': new_path}
         raise Resolver404, {'path' : path}
-- 
1.7.0

