mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 00:09:05 +00:00
Move to Python 3.7 and update dependencies (#551)
* forms: replace re._pattern_type with re.Pattern Python 3.7 removed re._pattern_type and replaced it with re.Pattern. * readme: update for Python 3.7 * Update requirements Also remove some unused ones which were neither a direct dependency nor a dependency of our dependencies. * account: force ASCII usernames on login form Our database doesn't like it when we check for unicode data in a column that stores ASCII data, so let's stop it before it gets that far. * Move travis CI to Python 3.7 * travis: use xenial dist * fix newer linter warnings Apparently bare excepts are literally Hitler, and we have some new import sorting rules. Hooray! * requirements: remove six This is a dependency for sqlalchemy-utils, but we ourselves don't depend on it directly because we've never been on Python 2 ever. * Update requirements.txt
This commit is contained in:
@@ -11,8 +11,9 @@ from wtforms import (BooleanField, HiddenField, PasswordField, SelectField, Stri
|
||||
SubmitField, TextAreaField)
|
||||
from wtforms.validators import (DataRequired, Email, EqualTo, Length, Optional, Regexp,
|
||||
StopValidation, ValidationError)
|
||||
from wtforms.widgets import HTMLString # For DisabledSelectField
|
||||
from wtforms.widgets import Select as SelectWidget # For DisabledSelectField
|
||||
from wtforms.widgets import HTMLString, html_params # For DisabledSelectField
|
||||
from wtforms.widgets import html_params
|
||||
|
||||
import dns.exception
|
||||
import dns.resolver
|
||||
@@ -78,7 +79,7 @@ def register_email_blacklist_validator(form, field):
|
||||
validation_exception = StopValidation('Blacklisted email provider')
|
||||
|
||||
for item in email_blacklist:
|
||||
if isinstance(item, re._pattern_type):
|
||||
if isinstance(item, re.Pattern):
|
||||
if item.search(email):
|
||||
raise validation_exception
|
||||
elif isinstance(item, str):
|
||||
|
||||
Reference in New Issue
Block a user