diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-07-05 17:45:26 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-15 19:19:14 +0000 |
commit | 604d06fb5763f44800c5f88e48e4476fad72f648 (patch) | |
tree | 9185cb6108543d17e81b90100b1ad434d58a79ed /util/locale_database/cldr.py | |
parent | 484a616d5e2ac011cb2e207eec22c65541fd58a2 (diff) |
Convert CLDR scripts to Python 3
The convertion is moslty done using 2to3 script with manual cleanup
afterwards.
Task-number: QTBUG-83488
Change-Id: I4d33b04e7269c55a83ff2deb876a23a78a89f39d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b02d17c5c0f01a6c24cacaea2a3a41bfcc37490f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'util/locale_database/cldr.py')
-rw-r--r-- | util/locale_database/cldr.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/locale_database/cldr.py b/util/locale_database/cldr.py index a65c649106..e3cbf2d2b6 100644 --- a/util/locale_database/cldr.py +++ b/util/locale_database/cldr.py @@ -153,7 +153,7 @@ class CldrReader (object): def __parseTags(self, locale): tags = self.__splitLocale(locale) - language = tags.next() + language = next(tags) script = territory = variant = '' try: script, territory, variant = tags @@ -171,10 +171,10 @@ class CldrReader (object): single tag (i.e. contains no underscores). Always yields 1 or 4 values, never 2 or 3.""" tags = iter(name.split('_')) - yield tags.next() # Language + yield next(tags) # Language try: - tag = tags.next() + tag = next(tags) except StopIteration: return @@ -182,7 +182,7 @@ class CldrReader (object): if len(tag) == 4 and tag[0].isupper() and tag[1:].islower(): yield tag try: - tag = tags.next() + tag = next(tags) except StopIteration: tag = '' else: @@ -192,7 +192,7 @@ class CldrReader (object): if tag and tag.isupper() or tag.isdigit(): yield tag try: - tag = tags.next() + tag = next(tags) except StopIteration: tag = '' else: @@ -726,7 +726,7 @@ enumdata.py (keeping the old name as an alias): except (KeyError, ValueError, TypeError): pass else: - if key not in seen or not elt.attributes.has_key('alt'): + if key not in seen or 'alt' not in elt.attributes: yield key, value seen.add(key) |