1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 18:09:59 +00:00

forms: replace re._pattern_type with re.Pattern

Python 3.7 removed re._pattern_type and replaced it with
re.Pattern.
This commit is contained in:
Nicolas F 2019-02-24 20:46:32 +01:00
parent 1374375a16
commit 50ec3ae6ca

View file

@ -78,7 +78,7 @@ def register_email_blacklist_validator(form, field):
validation_exception = StopValidation('Blacklisted email provider') validation_exception = StopValidation('Blacklisted email provider')
for item in email_blacklist: for item in email_blacklist:
if isinstance(item, re._pattern_type): if isinstance(item, re.Pattern):
if item.search(email): if item.search(email):
raise validation_exception raise validation_exception
elif isinstance(item, str): elif isinstance(item, str):