diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-07-06 09:20:56 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-15 19:19:16 +0000 |
commit | e3b20362d1df2e845ee02ac3ca0467444882a359 (patch) | |
tree | 46dddee54af14dc9d13b4f27d81469790e5d678f /util | |
parent | 604d06fb5763f44800c5f88e48e4476fad72f648 (diff) |
locale_database: Use super() to call base class methods
This is the standard way to call base class methods in Python 3 and
it is shorter than the custom one used now.
Task-number: QTBUG-83488
Change-Id: Ifaff591a46e92148fbf514856109ff794a50c9f7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2f4868548be8b3821cdbec047892b7d940c04908)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/locale_database/localetools.py | 9 | ||||
-rwxr-xr-x | util/locale_database/qlocalexml2cpp.py | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/util/locale_database/localetools.py b/util/locale_database/localetools.py index 82691666aa..1f415bbdb3 100644 --- a/util/locale_database/localetools.py +++ b/util/locale_database/localetools.py @@ -41,9 +41,8 @@ import os import tempfile class Error (Exception): - __upinit = Exception.__init__ def __init__(self, msg, *args): - self.__upinit(msg, *args) + super().__init__(msg, *args) self.message = msg def __str__(self): return self.message @@ -126,7 +125,6 @@ class SourceFileEditor (Transcriber): Callers should call close() on success or cleanup() on failure (to clear away the temporary file); see Transcriber. """ - __upinit = Transcriber.__init__ def __init__(self, path, temp): """Set up the source file editor. @@ -134,13 +132,12 @@ class SourceFileEditor (Transcriber): and, on success, replaced with a new version; and the directory in which to store the temporary file during the rewrite.""" - self.__upinit(path, temp) + super().__init__(path, temp) self.__copyPrelude() - __upclose = Transcriber.close def close(self): self.__copyTail() - self.__upclose() + super().close() # Implementation details: GENERATED_BLOCK_START = '// GENERATED PART STARTS HERE' diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py index e510a49259..6ddb1dbd88 100755 --- a/util/locale_database/qlocalexml2cpp.py +++ b/util/locale_database/qlocalexml2cpp.py @@ -133,9 +133,8 @@ def currencyIsoCodeData(s): return "{0,0,0}" class LocaleSourceEditor (SourceFileEditor): - __upinit = SourceFileEditor.__init__ def __init__(self, path, temp, version): - self.__upinit(path, temp) + super().__init__(path, temp) self.writer.write(""" /* This part of the file was generated on {} from the @@ -447,9 +446,8 @@ class CalendarDataWriter (LocaleSourceEditor): months_data.write(self.writer) class LocaleHeaderWriter (SourceFileEditor): - __upinit = SourceFileEditor.__init__ def __init__(self, path, temp, dupes): - self.__upinit(path, temp) + super().__init__(path, temp) self.__dupes = dupes def languages(self, languages): |