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/core/validators.py | |
| parent | f6acd1d271122d66de8061e75ae26137ddf02658 (diff) | |
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/core/validators.py')
| -rw-r--r-- | django/core/validators.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index 221f3e0934..e2fcd6f72e 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -2,7 +2,6 @@ import os import re from django.core.exceptions import ValidationError -from django.utils import six from django.utils.deconstruct import deconstructible from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject @@ -18,7 +17,7 @@ def _lazy_re_compile(regex, flags=0): """Lazily compile a regex with flags.""" def _compile(): # Compile the regex if it was not passed pre-compiled. - if isinstance(regex, six.string_types): + if isinstance(regex, str): return re.compile(regex, flags) else: assert not flags, "flags must be empty if regex is passed pre-compiled" @@ -45,7 +44,7 @@ class RegexValidator(object): self.inverse_match = inverse_match if flags is not None: self.flags = flags - if self.flags and not isinstance(self.regex, six.string_types): + if self.flags and not isinstance(self.regex, str): raise TypeError("If the flags are set, regex must be a regular expression string.") self.regex = _lazy_re_compile(self.regex, self.flags) |
