diff options
author | Vincent Post <cent@spline.de> | 2020-08-07 16:57:39 +0200 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2023-05-22 00:28:11 +0200 |
commit | c70cd40a012760e584677940d90d4d6613176238 (patch) | |
tree | a38308fd83e59449c0e64b5344be1e89c766dd4d /accounts/utils/__init__.py | |
parent | b8621b58e879732ecf81593dc34638533df2a212 (diff) | |
download | web-c70cd40a012760e584677940d90d4d6613176238.tar.gz web-c70cd40a012760e584677940d90d4d6613176238.tar.bz2 web-c70cd40a012760e584677940d90d4d6613176238.zip |
2to3 -w accounts contrib
Diffstat (limited to 'accounts/utils/__init__.py')
-rw-r--r-- | accounts/utils/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/accounts/utils/__init__.py b/accounts/utils/__init__.py index 7e658d0..8d49363 100644 --- a/accounts/utils/__init__.py +++ b/accounts/utils/__init__.py @@ -25,7 +25,7 @@ def templated(template=None): def ensure_utf8(s): - if isinstance(s, unicode): + if isinstance(s, str): s = s.encode('utf8') return s @@ -35,9 +35,9 @@ class NotRegexp(Regexp): Like wtforms.validators.Regexp, but rejects data that DOES match the regex. """ def __call__(self, form, field): - if self.regex.match(field.data or u''): + if self.regex.match(field.data or ''): if self.message is None: - self.message = field.gettext(u'Invalid input.') + self.message = field.gettext('Invalid input.') raise ValidationError(self.message) |