From 839b427ea5ca0132d1ed72732d8e9ab578269a3f Mon Sep 17 00:00:00 2001 From: rht Date: Thu, 2 Nov 2017 09:22:26 +0100 Subject: [PATCH] zerver/management: Remove u prefix from strings. License: Apache-2.0 Signed-off-by: rht --- zerver/management/commands/compilemessages.py | 6 +++--- zerver/management/commands/makemessages.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zerver/management/commands/compilemessages.py b/zerver/management/commands/compilemessages.py index 19adfed4e8..6664b82fee 100644 --- a/zerver/management/commands/compilemessages.py +++ b/zerver/management/commands/compilemessages.py @@ -81,8 +81,8 @@ class Command(compilemessages.Command): return locales def extract_language_options(self) -> None: - locale_path = u"{}/locale".format(settings.STATIC_ROOT) - output_path = u"{}/language_options.json".format(locale_path) + locale_path = "{}/locale".format(settings.STATIC_ROOT) + output_path = "{}/language_options.json".format(locale_path) data = {'languages': []} # type: Dict[str, List[Dict[str, Any]]] @@ -92,7 +92,7 @@ class Command(compilemessages.Command): # In case we are not under a Git repo, fallback to getting the # locales using listdir(). locales = os.listdir(locale_path) - locales.append(u'en') + locales.append('en') locales = list(set(locales)) for locale in locales: diff --git a/zerver/management/commands/makemessages.py b/zerver/management/commands/makemessages.py index 15ce4462f1..08eae99729 100644 --- a/zerver/management/commands/makemessages.py +++ b/zerver/management/commands/makemessages.py @@ -46,8 +46,8 @@ from django.utils.translation import template from zerver.lib.str_utils import force_text -strip_whitespace_right = re.compile(u"(%s-?\\s*(trans|pluralize).*?-%s)\\s+" % (BLOCK_TAG_START, BLOCK_TAG_END), re.U) -strip_whitespace_left = re.compile(u"\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" % ( +strip_whitespace_right = re.compile("(%s-?\\s*(trans|pluralize).*?-%s)\\s+" % (BLOCK_TAG_START, BLOCK_TAG_END), re.U) +strip_whitespace_left = re.compile("\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" % ( BLOCK_TAG_START, BLOCK_TAG_END), re.U) regexes = ['{{#tr .*?}}([\s\S]*?){{/tr}}', # '.' doesn't match '\n' by default @@ -64,8 +64,8 @@ multiline_js_comment = re.compile("/\*.*?\*/", re.DOTALL) singleline_js_comment = re.compile("//.*?\n") def strip_whitespaces(src: Text) -> Text: - src = strip_whitespace_left.sub(u'\\1', src) - src = strip_whitespace_right.sub(u'\\1', src) + src = strip_whitespace_left.sub('\\1', src) + src = strip_whitespace_right.sub('\\1', src) return src class Command(makemessages.Command):