summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/urls/resolvers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index 7b9db5506f..0208601f79 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -135,7 +135,9 @@ class RegexURLPattern(LocaleRegexProvider):
'path.to.ClassBasedView').
"""
callback = self.callback
- if isinstance(callback, functools.partial):
+ # Python 3.5 collapses nested partials, so can change "while" to "if"
+ # when it's the minimum supported version.
+ while isinstance(callback, functools.partial):
callback = callback.func
if not hasattr(callback, '__name__'):
return callback.__module__ + "." + callback.__class__.__name__