diff options
Diffstat (limited to 'django/urls')
-rw-r--r-- | django/urls/converters.py | 5 | ||||
-rw-r--r-- | django/urls/resolvers.py | 4 |
2 files changed, 2 insertions, 7 deletions
diff --git a/django/urls/converters.py b/django/urls/converters.py index eb2a61971e..cc22f33df4 100644 --- a/django/urls/converters.py +++ b/django/urls/converters.py @@ -60,10 +60,7 @@ def register_converter(converter, type_name): @lru_cache.lru_cache(maxsize=None) def get_converters(): - converters = {} - converters.update(DEFAULT_CONVERTERS) - converters.update(REGISTERED_CONVERTERS) - return converters + return {**DEFAULT_CONVERTERS, **REGISTERED_CONVERTERS} def get_converter(raw_converter): diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py index 4cd25ff075..b214264445 100644 --- a/django/urls/resolvers.py +++ b/django/urls/resolvers.py @@ -343,9 +343,7 @@ class URLPattern: 'path.to.ClassBasedView'). """ callback = self.callback - # Python 3.5 collapses nested partials, so can change "while" to "if" - # when it's the minimum supported version. - while isinstance(callback, functools.partial): + if isinstance(callback, functools.partial): callback = callback.func if not hasattr(callback, '__name__'): return callback.__module__ + "." + callback.__class__.__name__ |