diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-12-29 16:27:49 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 20:18:46 +0100 |
| commit | 7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch) | |
| tree | 313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /django/urls/resolvers.py | |
| parent | f6acd1d271122d66de8061e75ae26137ddf02658 (diff) | |
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/urls/resolvers.py')
| -rw-r--r-- | django/urls/resolvers.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py index 4e8bded3db..cf2fe0ecec 100644 --- a/django/urls/resolvers.py +++ b/django/urls/resolvers.py @@ -14,7 +14,7 @@ from django.conf import settings from django.core.checks import Warning from django.core.checks.urls import check_resolver from django.core.exceptions import ImproperlyConfigured -from django.utils import lru_cache, six +from django.utils import lru_cache from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_str, force_text from django.utils.functional import cached_property @@ -87,7 +87,7 @@ class LocaleRegexDescriptor(object): # As a performance optimization, if the given regex string is a regular # string (not a lazily-translated string proxy), compile it once and # avoid per-language compilation. - if isinstance(instance._regex, six.string_types): + if isinstance(instance._regex, str): instance.__dict__['regex'] = self._compile(instance._regex) return instance.__dict__['regex'] language_code = get_language() @@ -103,8 +103,7 @@ class LocaleRegexDescriptor(object): return re.compile(regex, re.UNICODE) except re.error as e: raise ImproperlyConfigured( - '"%s" is not a valid regular expression: %s' % - (regex, six.text_type(e)) + '"%s" is not a valid regular expression: %s' % (regex, e) ) @@ -388,7 +387,7 @@ class RegexURLResolver(LocaleRegexProvider): @cached_property def urlconf_module(self): - if isinstance(self.urlconf_name, six.string_types): + if isinstance(self.urlconf_name, str): return import_module(self.urlconf_name) else: return self.urlconf_name |
