summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-07-07 13:23:12 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-08 09:03:51 +0000
commit47700b11e77639bfe6b3c746bb11a4259009547b (patch)
treeda329390d25dbaf1a95aed4ad837e979e0e4f7e3 /util
parent8b31d1475cd9e904765bbbe10cfe86f8905438cb (diff)
locale_database: Don't attempt to access property 'message' of IOError
IOError does not have property 'message' in Python 3. Instead of attempting to access it, just use the string representation of the exception object. This produces the error message possibly combined with additional arguments in both Python 2 and Python 3. Task-number: QTBUG-83488 Change-Id: Icb198a409e7f80b832e474d8390b770fdeacc6c2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 230014608571c2ad88b740455f4ffe1b963cad22) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/locale_database/cldr2qtimezone.py4
-rwxr-xr-xutil/locale_database/qlocalexml2cpp.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/util/locale_database/cldr2qtimezone.py b/util/locale_database/cldr2qtimezone.py
index c5eb61c2a8..1e783b6add 100755
--- a/util/locale_database/cldr2qtimezone.py
+++ b/util/locale_database/cldr2qtimezone.py
@@ -363,7 +363,7 @@ def main(args, out, err):
dict((name, ind) for ind, name in enumerate((x[0] for x in windowsIdList), 1)))
except IOError as e:
usage(err, name,
- 'Failed to open common/supplemental/windowsZones.xml: ' + (e.message or e.args[1]))
+ 'Failed to open common/supplemental/windowsZones.xml: ' + str(e))
return 1
except Error as e:
err.write('\n'.join(textwrap.wrap(
@@ -375,7 +375,7 @@ def main(args, out, err):
try:
writer = ZoneIdWriter(dataFilePath, qtPath)
except IOError as e:
- err.write('Failed to open files to transcribe: {}'.format(e.message or e.args[1]))
+ err.write('Failed to open files to transcribe: {}'.format(e))
return 1
try:
diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py
index 60d0e69228..8194b15755 100755
--- a/util/locale_database/qlocalexml2cpp.py
+++ b/util/locale_database/qlocalexml2cpp.py
@@ -552,7 +552,7 @@ def main(args, out, err):
'qlocale_data_p.h'),
qtsrcdir, reader.cldrVersion)
except IOError as e:
- err.write('Failed to open files to transcribe locale data: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe locale data: ' + str(e))
return 1
try:
@@ -582,7 +582,7 @@ def main(args, out, err):
qtsrcdir, reader.cldrVersion)
except IOError as e:
err.write('Failed to open files to transcribe ' + calendar
- + ' data ' + (e.message or e.args[1]))
+ + ' data ' + str(e))
return 1
try:
@@ -599,7 +599,7 @@ def main(args, out, err):
writer = LocaleHeaderWriter(os.path.join(qtsrcdir, 'src', 'corelib', 'text', 'qlocale.h'),
qtsrcdir, reader.dupes)
except IOError as e:
- err.write('Failed to open files to transcribe qlocale.h: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe qlocale.h: ' + str(e))
return 1
try:
@@ -618,7 +618,7 @@ def main(args, out, err):
writer = Transcriber(os.path.join(qtsrcdir, 'src', 'corelib', 'text', 'qlocale.qdoc'),
qtsrcdir)
except IOError as e:
- err.write('Failed to open files to transcribe qlocale.qdoc: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe qlocale.qdoc: ' + str(e))
return 1
DOCSTRING = " QLocale's data is based on Common Locale Data Repository "