diff --git a/babel/__init__.py b/babel/__init__.py index 90a15cf7b..1e0830a60 100644 --- a/babel/__init__.py +++ b/babel/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel ~~~~~ diff --git a/babel/core.py b/babel/core.py index 67387ac19..9393c2394 100644 --- a/babel/core.py +++ b/babel/core.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.core ~~~~~~~~~~ @@ -105,7 +104,7 @@ def __init__(self, identifier): self.identifier = identifier -class Locale(object): +class Locale: """Representation of a specific locale. >>> locale = Locale('en', 'US') diff --git a/babel/dates.py b/babel/dates.py index 74fc6db71..6e049e906 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.dates ~~~~~~~~~~~ @@ -16,7 +15,6 @@ :license: BSD, see LICENSE for more details. """ -from __future__ import division import re import warnings @@ -262,7 +260,7 @@ def get_next_timezone_transition(zone=None, dt=None): ) -class TimezoneTransition(object): +class TimezoneTransition: """A helper object that represents the return value from :func:`get_next_timezone_transition`. @@ -1207,7 +1205,7 @@ def parse_date(string, locale=LC_TIME, format='medium'): indexes = [(year_idx, 'Y'), (month_idx, 'M'), (day_idx, 'D')] indexes.sort() - indexes = dict([(item[1], idx) for idx, item in enumerate(indexes)]) + indexes = {item[1]: idx for idx, item in enumerate(indexes)} # FIXME: this currently only supports numbers, but should also support month # names, both in the requested locale, and english @@ -1253,7 +1251,7 @@ def parse_time(string, locale=LC_TIME, format='medium'): indexes = [(hour_idx, 'H'), (min_idx, 'M'), (sec_idx, 'S')] indexes.sort() - indexes = dict([(item[1], idx) for idx, item in enumerate(indexes)]) + indexes = {item[1]: idx for idx, item in enumerate(indexes)} # TODO: support time zones @@ -1274,7 +1272,7 @@ def parse_time(string, locale=LC_TIME, format='medium'): return time(hour, minute, second) -class DateTimePattern(object): +class DateTimePattern: def __init__(self, pattern, format): self.pattern = pattern @@ -1299,7 +1297,7 @@ def apply(self, datetime, locale): return self % DateTimeFormat(datetime, locale) -class DateTimeFormat(object): +class DateTimeFormat: def __init__(self, value, locale): assert isinstance(value, (date, datetime, time)) diff --git a/babel/languages.py b/babel/languages.py index 097436705..cac59c162 100644 --- a/babel/languages.py +++ b/babel/languages.py @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- from babel.core import get_global diff --git a/babel/lists.py b/babel/lists.py index 431acd806..11cc7d725 100644 --- a/babel/lists.py +++ b/babel/lists.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.lists ~~~~~~~~~~~ diff --git a/babel/localedata.py b/babel/localedata.py index 9461e8451..14e6bcdf4 100644 --- a/babel/localedata.py +++ b/babel/localedata.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.localedata ~~~~~~~~~~~~~~~~ @@ -184,7 +183,7 @@ def merge(dict1, dict2): dict1[key] = val1 -class Alias(object): +class Alias: """Representation of an alias in the locale data. An alias is a value that refers to some other part of the locale data, diff --git a/babel/localtime/__init__.py b/babel/localtime/__init__.py index 537ceb520..7e626a0f1 100644 --- a/babel/localtime/__init__.py +++ b/babel/localtime/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.localtime ~~~~~~~~~~~~~~~ diff --git a/babel/localtime/_unix.py b/babel/localtime/_unix.py index c2194694c..28b253394 100644 --- a/babel/localtime/_unix.py +++ b/babel/localtime/_unix.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import with_statement import os import re import sys @@ -107,7 +105,7 @@ def _get_localzone(_root='/'): tzpath = os.path.join(_root, filename) if not os.path.exists(tzpath): continue - with open(tzpath, 'rt') as tzfile: + with open(tzpath) as tzfile: for line in tzfile: match = timezone_re.match(line) if match is not None: diff --git a/babel/messages/__init__.py b/babel/messages/__init__.py index 58466c678..ad4fd346d 100644 --- a/babel/messages/__init__.py +++ b/babel/messages/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages ~~~~~~~~~~~~~~ diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py index 228b10b71..564b2c7c8 100644 --- a/babel/messages/catalog.py +++ b/babel/messages/catalog.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ @@ -69,7 +68,7 @@ def _parse_datetime_header(value): return dt -class Message(object): +class Message: """Representation of a single message in a catalog.""" def __init__(self, id, string=u'', locations=(), flags=(), auto_comments=(), @@ -227,7 +226,7 @@ class TranslationError(Exception): #""" -class Catalog(object): +class Catalog: """Representation of a message catalog.""" def __init__(self, locale=None, domain=None, header_comment=DEFAULT_HEADER, @@ -755,10 +754,10 @@ def update(self, template, no_fuzzy_matching=False, update_header_comment=False, # Prepare for fuzzy matching fuzzy_candidates = [] if not no_fuzzy_matching: - fuzzy_candidates = dict([ - (self._key_for(msgid), messages[msgid].context) + fuzzy_candidates = { + self._key_for(msgid): messages[msgid].context for msgid in messages if msgid and messages[msgid].string - ]) + } fuzzy_matches = set() def _merge(message, oldkey, newkey): diff --git a/babel/messages/checkers.py b/babel/messages/checkers.py index b79bd8257..4292c02d3 100644 --- a/babel/messages/checkers.py +++ b/babel/messages/checkers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.checkers ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/babel/messages/extract.py b/babel/messages/extract.py index c23a924b3..c95f1cbc9 100644 --- a/babel/messages/extract.py +++ b/babel/messages/extract.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.extract ~~~~~~~~~~~~~~~~~~~~~~ @@ -163,7 +162,7 @@ def extract_from_dir( for filename in filenames: filepath = os.path.join(root, filename).replace(os.sep, '/') - for message_tuple in check_and_call_extract_file( + yield from check_and_call_extract_file( filepath, method_map, options_map, @@ -172,8 +171,7 @@ def extract_from_dir( comment_tags, strip_comment_tags, dirpath=absname, - ): - yield message_tuple + ) def check_and_call_extract_file(filepath, method_map, options_map, diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 73e421285..6e09d1095 100644 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ @@ -8,7 +7,6 @@ :copyright: (c) 2013-2022 by the Babel Team. :license: BSD, see LICENSE for more details. """ -from __future__ import print_function import fnmatch import logging @@ -883,7 +881,7 @@ def run(self): return -class CommandLineInterface(object): +class CommandLineInterface: """Command-line interface. This class provides a simple command-line interface to the message @@ -937,7 +935,7 @@ def run(self, argv=None): self._configure_logging(options.loglevel) if options.list_locales: identifiers = localedata.locale_identifiers() - longest = max([len(identifier) for identifier in identifiers]) + longest = max(len(identifier) for identifier in identifiers) identifiers.sort() format = u'%%-%ds %%s' % (longest + 1) for identifier in identifiers: @@ -974,7 +972,7 @@ def _configure_logging(self, loglevel): def _help(self): print(self.parser.format_help()) print("commands:") - longest = max([len(command) for command in self.commands]) + longest = max(len(command) for command in self.commands) format = " %%-%ds %%s" % max(8, longest + 1) commands = sorted(self.commands.items()) for name, description in commands: @@ -1094,7 +1092,7 @@ def parse_mapping(fileobj, filename=None): if section == 'extractors': extractors = dict(parser.items(section)) else: - method, pattern = [part.strip() for part in section.split(':', 1)] + method, pattern = (part.strip() for part in section.split(':', 1)) method_map.append((pattern, method)) options_map[pattern] = dict(parser.items(section)) diff --git a/babel/messages/jslexer.py b/babel/messages/jslexer.py index ef30c993e..c1c25575c 100644 --- a/babel/messages/jslexer.py +++ b/babel/messages/jslexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.jslexer ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/babel/messages/mofile.py b/babel/messages/mofile.py index 901f98d1b..828457408 100644 --- a/babel/messages/mofile.py +++ b/babel/messages/mofile.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.mofile ~~~~~~~~~~~~~~~~~~~~~ @@ -48,7 +47,7 @@ def read_mo(fileobj): version, msgcount, origidx, transidx = unpack('>4I', buf[4:20]) ii = '>II' else: - raise IOError(0, 'Bad magic number', filename) + raise OSError(0, 'Bad magic number', filename) # Now put all messages from the .mo file buffer into the catalog # dictionary @@ -61,7 +60,7 @@ def read_mo(fileobj): msg = buf[moff:mend] tmsg = buf[toff:tend] else: - raise IOError(0, 'File is corrupt', filename) + raise OSError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0: diff --git a/babel/messages/plurals.py b/babel/messages/plurals.py index 52711a295..8722566dc 100644 --- a/babel/messages/plurals.py +++ b/babel/messages/plurals.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.plurals ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/babel/messages/pofile.py b/babel/messages/pofile.py index bd29e731a..b94274df2 100644 --- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.messages.pofile ~~~~~~~~~~~~~~~~~~~~~ @@ -10,7 +9,6 @@ :license: BSD, see LICENSE for more details. """ -from __future__ import print_function import os import re @@ -75,13 +73,13 @@ def denormalize(string): class PoFileError(Exception): """Exception thrown by PoParser when an invalid po file is encountered.""" def __init__(self, message, catalog, line, lineno): - super(PoFileError, self).__init__('{message} on {lineno}'.format(message=message, lineno=lineno)) + super().__init__(f'{message} on {lineno}') self.catalog = catalog self.line = line self.lineno = lineno -class _NormalizedString(object): +class _NormalizedString: def __init__(self, *args): self._strs = [] @@ -128,7 +126,7 @@ def __ne__(self, other): -class PoFileParser(object): +class PoFileParser: """Support class to read messages from a ``gettext`` PO (portable object) file and add them to a `Catalog` @@ -170,7 +168,7 @@ def _add_message(self): """ self.translations.sort() if len(self.messages) > 1: - msgid = tuple([m.denormalize() for m in self.messages]) + msgid = tuple(m.denormalize() for m in self.messages) else: msgid = self.messages[0].denormalize() if isinstance(msgid, (list, tuple)): diff --git a/babel/numbers.py b/babel/numbers.py index 904ebbeef..b8971bcbc 100644 --- a/babel/numbers.py +++ b/babel/numbers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.numbers ~~~~~~~~~~~~~ @@ -661,7 +660,7 @@ class NumberFormatError(ValueError): """Exception raised when a string cannot be parsed into a number.""" def __init__(self, message, suggestions=None): - super(NumberFormatError, self).__init__(message) + super().__init__(message) #: a list of properly formatted numbers derived from the invalid input self.suggestions = suggestions @@ -872,7 +871,7 @@ def parse_precision(p): exp_prec, exp_plus) -class NumberPattern(object): +class NumberPattern: def __init__(self, pattern, prefix, suffix, grouping, int_prec, frac_prec, exp_prec, exp_plus): diff --git a/babel/plural.py b/babel/plural.py index f06e90e45..d3dc22d32 100644 --- a/babel/plural.py +++ b/babel/plural.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.numbers ~~~~~~~~~~~~~ @@ -75,7 +74,7 @@ def extract_operands(source): return n, i, v, w, f, t, c, e -class PluralRule(object): +class PluralRule: """Represents a set of language pluralization rules. The constructor accepts a list of (tag, expr) tuples or a dict of `CLDR rules`_. The resulting object is callable and accepts one parameter with a positive or @@ -149,9 +148,9 @@ def rules(self): {'one': 'n is 1'} """ _compile = _UnicodeCompiler().compile - return dict([(tag, _compile(ast)) for tag, ast in self.abstract]) + return {tag: _compile(ast) for tag, ast in self.abstract} - tags = property(lambda x: frozenset([i[0] for i in x.abstract]), doc=""" + tags = property(lambda x: frozenset(i[0] for i in x.abstract), doc=""" A set of explicitly defined tags in this rule. The implicit default ``'other'`` rules is not part of this set unless there is an explicit rule for it.""") @@ -385,7 +384,7 @@ def negate(rv): return 'not', (rv,) -class _Parser(object): +class _Parser: """Internal parser. This class can translate a single rule into an abstract tree of tuples. It implements the following grammar:: @@ -521,7 +520,7 @@ def _unary_compiler(tmpl): compile_zero = lambda x: '0' -class _Compiler(object): +class _Compiler: """The compilers are able to transform the expressions into multiple output formats. """ diff --git a/babel/support.py b/babel/support.py index a22bffcdc..dbd914e4a 100644 --- a/babel/support.py +++ b/babel/support.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.support ~~~~~~~~~~~~~ @@ -22,7 +21,7 @@ format_percent, format_scientific -class Format(object): +class Format: """Wrapper class providing the various date and number formatting functions bound to a specific locale and time-zone. @@ -129,7 +128,7 @@ def scientific(self, number): return format_scientific(number, locale=self.locale) -class LazyProxy(object): +class LazyProxy: """Class for proxy objects that delegate to a specified function to evaluate the actual object. @@ -288,7 +287,7 @@ def __deepcopy__(self, memo): ) -class NullTranslations(gettext.NullTranslations, object): +class NullTranslations(gettext.NullTranslations): DEFAULT_DOMAIN = None @@ -304,7 +303,7 @@ def __init__(self, fp=None): # some *gettext methods (including '.gettext()') rely on the attributes. self._catalog = {} self.plural = lambda n: int(n != 1) - super(NullTranslations, self).__init__(fp=fp) + super().__init__(fp=fp) self.files = list(filter(None, [getattr(fp, 'name', None)])) self.domain = self.DEFAULT_DOMAIN self._domains = {} @@ -534,7 +533,7 @@ def __init__(self, fp=None, domain=None): :param fp: the file-like object the translation should be read from :param domain: the message domain (default: 'messages') """ - super(Translations, self).__init__(fp=fp) + super().__init__(fp=fp) self.domain = domain or self.DEFAULT_DOMAIN ugettext = gettext.GNUTranslations.gettext diff --git a/babel/units.py b/babel/units.py index bec8676aa..8a9ec7d38 100644 --- a/babel/units.py +++ b/babel/units.py @@ -1,5 +1,3 @@ -# -- encoding: UTF-8 -- - from babel.core import Locale from babel.numbers import format_decimal, LC_NUMERIC diff --git a/babel/util.py b/babel/util.py index 2cac55336..f628844ab 100644 --- a/babel/util.py +++ b/babel/util.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ babel.util ~~~~~~~~~~ diff --git a/docs/conf.py b/docs/conf.py index 8f583fa83..0acdc0a1b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Babel documentation build configuration file, created by # sphinx-quickstart on Wed Jul 3 17:53:01 2013. diff --git a/scripts/dump_data.py b/scripts/dump_data.py index 3edd971f0..e41905000 100755 --- a/scripts/dump_data.py +++ b/scripts/dump_data.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/scripts/dump_global.py b/scripts/dump_global.py index 2938b259b..6696415e6 100755 --- a/scripts/dump_global.py +++ b/scripts/dump_global.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index 6fe9b8bd5..dbeb1b630 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. @@ -301,8 +300,8 @@ def parse_global(srcdir, sup): all_currencies[cur_code].add(region_code) region_currencies.sort(key=_currency_sort_key) territory_currencies[region_code] = region_currencies - global_data['all_currencies'] = dict([ - (currency, tuple(sorted(regions))) for currency, regions in all_currencies.items()]) + global_data['all_currencies'] = { + currency: tuple(sorted(regions)) for currency, regions in all_currencies.items()} # Explicit parent locales for paternity in sup.findall('.//parentLocales/parentLocale'): @@ -343,7 +342,7 @@ def _process_local_datas(sup, srcdir, destdir, force=False, dump_json=False): region_items = sorted(regions.items()) for group, territory_list in region_items: for territory in territory_list: - containers = territory_containment.setdefault(territory, set([])) + containers = territory_containment.setdefault(territory, set()) if group in territory_containment: containers |= territory_containment[group] containers.add(group) @@ -964,10 +963,10 @@ def parse_day_period_rules(tree): type = rule.attrib["type"] if type in ("am", "pm"): # These fixed periods are handled separately by `get_period_id` continue - rule = _compact_dict(dict( - (key, _time_to_seconds_past_midnight(rule.attrib.get(key))) + rule = _compact_dict({ + key: _time_to_seconds_past_midnight(rule.attrib.get(key)) for key in ("after", "at", "before", "from", "to") - )) + }) for locale in locales: dest_list = day_periods.setdefault(locale, {}).setdefault(ruleset_type, {}).setdefault(type, []) dest_list.append(rule) diff --git a/scripts/make-release.py b/scripts/make-release.py index f780f0d97..d8963f2cb 100755 --- a/scripts/make-release.py +++ b/scripts/make-release.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """ make-release ~~~~~~~~~~~~ diff --git a/setup.py b/setup.py index e081219e6..5cde8022d 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import subprocess import sys diff --git a/tests/messages/test_catalog.py b/tests/messages/test_catalog.py index 830cabf1b..f32023620 100644 --- a/tests/messages/test_catalog.py +++ b/tests/messages/test_catalog.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/messages/test_checkers.py b/tests/messages/test_checkers.py index b709d4b7e..2ae594679 100644 --- a/tests/messages/test_checkers.py +++ b/tests/messages/test_checkers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/messages/test_extract.py b/tests/messages/test_extract.py index fb9599db6..3ed71de44 100644 --- a/tests/messages/test_extract.py +++ b/tests/messages/test_extract.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index 4ed30ec5a..bacb0e2d4 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. @@ -1194,7 +1193,7 @@ def test_update(self): '-o', po_file, '-i', tmpl_file ]) - with open(po_file, "r") as infp: + with open(po_file) as infp: catalog = read_po(infp) assert len(catalog) == 3 @@ -1210,7 +1209,7 @@ def test_update(self): '-o', po_file, '-i', tmpl_file]) - with open(po_file, "r") as infp: + with open(po_file) as infp: catalog = read_po(infp) assert len(catalog) == 4 # Catalog was updated @@ -1288,7 +1287,7 @@ def test_update_init_missing(self): '-o', po_file, '-i', tmpl_file]) - with open(po_file, "r") as infp: + with open(po_file) as infp: catalog = read_po(infp) assert len(catalog) == 3 @@ -1305,7 +1304,7 @@ def test_update_init_missing(self): '-o', po_file, '-i', tmpl_file]) - with open(po_file, "r") as infp: + with open(po_file) as infp: catalog = read_po(infp) assert len(catalog) == 4 # Catalog was updated diff --git a/tests/messages/test_js_extract.py b/tests/messages/test_js_extract.py index 73b16a934..72c521144 100644 --- a/tests/messages/test_js_extract.py +++ b/tests/messages/test_js_extract.py @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- from io import BytesIO import pytest from babel.messages import extract diff --git a/tests/messages/test_jslexer.py b/tests/messages/test_jslexer.py index b70621fc6..35204eee0 100644 --- a/tests/messages/test_jslexer.py +++ b/tests/messages/test_jslexer.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from babel.messages import jslexer diff --git a/tests/messages/test_mofile.py b/tests/messages/test_mofile.py index 93f3689a3..bf6ef5eb0 100644 --- a/tests/messages/test_mofile.py +++ b/tests/messages/test_mofile.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/messages/test_plurals.py b/tests/messages/test_plurals.py index 0d205411d..df17fd866 100644 --- a/tests/messages/test_plurals.py +++ b/tests/messages/test_plurals.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/messages/test_pofile.py b/tests/messages/test_pofile.py index b154c0909..632efe7b6 100644 --- a/tests/messages/test_pofile.py +++ b/tests/messages/test_pofile.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_core.py b/tests/test_core.py index 53578f81f..529a424a0 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_date_intervals.py b/tests/test_date_intervals.py index 4f4217054..dc3ae346f 100644 --- a/tests/test_date_intervals.py +++ b/tests/test_date_intervals.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import datetime from babel import dates diff --git a/tests/test_dates.py b/tests/test_dates.py index 936746698..6a24ed40c 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_day_periods.py b/tests/test_day_periods.py index 52cbc5e4f..414c0f6e5 100644 --- a/tests/test_day_periods.py +++ b/tests/test_day_periods.py @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- from datetime import time import babel.dates as dates diff --git a/tests/test_languages.py b/tests/test_languages.py index 32f0d67d5..41fcc9e83 100644 --- a/tests/test_languages.py +++ b/tests/test_languages.py @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- from babel.languages import get_official_languages, get_territory_language_info diff --git a/tests/test_lists.py b/tests/test_lists.py index e843a6358..e51f18b23 100644 --- a/tests/test_lists.py +++ b/tests/test_lists.py @@ -1,4 +1,3 @@ -# coding=utf-8 import pytest from babel import lists diff --git a/tests/test_localedata.py b/tests/test_localedata.py index e93309bd4..8c4e40ec8 100644 --- a/tests/test_localedata.py +++ b/tests/test_localedata.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_numbers.py b/tests/test_numbers.py index 3fab394df..bac6c61c9 100644 --- a/tests/test_numbers.py +++ b/tests/test_numbers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_plural.py b/tests/test_plural.py index b0230c79a..421003324 100644 --- a/tests/test_plural.py +++ b/tests/test_plural.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 052c1cb4c..aed676a16 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- """ These tests do not verify any results and should not be run when looking at improving test coverage. They just verify that basic diff --git a/tests/test_support.py b/tests/test_support.py index 6e4c44b19..a4fa3267a 100644 --- a/tests/test_support.py +++ b/tests/test_support.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved. diff --git a/tests/test_util.py b/tests/test_util.py index 43076ad93..e6a19d51a 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software, 2013-2022 the Babel team # All rights reserved.