From 0178fcb3ef873aefed2fa95c1eecfe76b5da4722 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sat, 22 Jan 2022 16:47:07 +0100 Subject: [PATCH] Remove some python2 --> python3 leftovers Remove some __future__ imports and the six compability layer (which was not mentioned in the requirements.txt anyway). --- clear_contest.py | 2 -- contest/apps.py | 2 -- contest/models.py | 2 -- contest/validators.py | 8 ++++---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/clear_contest.py b/clear_contest.py index 5fc5996..6b07c16 100755 --- a/clear_contest.py +++ b/clear_contest.py @@ -1,6 +1,4 @@ #!/usr/bin/env python -from __future__ import print_function - # prepare environment import sys sys.path.append("..") diff --git a/contest/apps.py b/contest/apps.py index b77a40b..dbe17cd 100644 --- a/contest/apps.py +++ b/contest/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig diff --git a/contest/models.py b/contest/models.py index a612032..674b004 100644 --- a/contest/models.py +++ b/contest/models.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import datetime from django.contrib.auth.models import AbstractUser diff --git a/contest/validators.py b/contest/validators.py index fecd7ed..75f5730 100644 --- a/contest/validators.py +++ b/contest/validators.py @@ -1,7 +1,6 @@ from django.core import validators -from django.utils import six from django.utils.deconstruct import deconstructible -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import re @@ -13,7 +12,8 @@ class CallUsernameValidator(validators.RegexValidator): 'Enter a valid Callsign as Username, ALL UPPERCASE, if needed with -1 / -2,' 'e.g. DL7BST, DN1BER-1, DL/OE1FOO.' ) - flags = re.ASCII if six.PY3 else 0 + flags = re.ASCII + @deconstructible class CallLogValidator(validators.RegexValidator): @@ -22,4 +22,4 @@ class CallLogValidator(validators.RegexValidator): 'Enter a valid callsign, ALL UPPERCASE, if needed with -1 / -2,' 'e.g. DL7BST, DN1BER-1, DL/OE1FOO, DN1FTW-1/p' ) - flags = re.ASCII if six.PY3 else 0 + flags = re.ASCII